[maint,2/2] batman-adv: free skb on TVLV parsing success
Commit Message
From: Antonio Quartulli <antonio@open-mesh.com>
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 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
("batman-adv: tvlv - basic infrastructure")
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
routing.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Tuesday 11 February 2014 17:05:07 Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
>
> 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 0b6aa0d43767889eeda43a132cf5e73df4e63bf2
> ("batman-adv: tvlv - basic infrastructure")
>
> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
> ---
> routing.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied in revision 9289542.
Thanks,
Marek
@@ -1063,6 +1063,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;
}