Skip to content

Commit

Permalink
batman-adv: free skb on TVLV parsing success
Browse files Browse the repository at this point in the history
When the TVLV parsing routine succeed the skb is left
untouched thus leading to a memory leak.

Fix this by consuming the skb in case of success.

Introduced by ef26157
("batman-adv: tvlv - basic infrastructure")

Reported-by: Russel Senior <russell@personaltelco.net>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Tested-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
  • Loading branch information
Antonio Quartulli authored and Antonio Quartulli committed Feb 17, 2014
1 parent a30e22c commit 05c3c8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,8 @@ int batadv_recv_unicast_tvlv(struct sk_buff *skb,

if (ret != NET_RX_SUCCESS)
ret = batadv_route_unicast_packet(skb, recv_if);
else
consume_skb(skb);

return ret;
}
Expand Down

0 comments on commit 05c3c8a

Please sign in to comment.