bat_events: page allocation failure (batman-adv maint)
Commit Message
Staging: batman-adv: Fix skbuff leak in VIS code.
The vis code takes a copy of the data inside the skbuf if it is interesting
for us, so we always need to release the skbuf.
Reported-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Comments
On Monday 25 January 2010 14:47:47 Andrew Lunn wrote:
> Staging: batman-adv: Fix skbuff leak in VIS code.
>
> The vis code takes a copy of the data inside the skbuf if it is
> interesting for us, so we always need to release the skbuf.
Applied in rev 1564.
Thanks,
Marek
Just tried the patch on the routers and it works perfectly, no
more memory leak caused by vis! Thanks for the quick fix.
Cheers, Linus
===================================================================
@@ -1135,21 +1135,22 @@
if (is_my_mac(vis_packet->sender_orig))
return NET_RX_DROP;
+ /* We take a copy of the data in the packet, so we should
+ always free the skbuf. */
+ ret = NET_RX_DROP;
+
switch (vis_packet->vis_type) {
case VIS_TYPE_SERVER_SYNC:
/* TODO: handle fragmented skbs properly */
receive_server_sync_packet(vis_packet, skb_headlen(skb));
- ret = NET_RX_SUCCESS;
break;
case VIS_TYPE_CLIENT_UPDATE:
/* TODO: handle fragmented skbs properly */
receive_client_update_packet(vis_packet, skb_headlen(skb));
- ret = NET_RX_SUCCESS;
break;
default: /* ignore unknown packet */
- ret = NET_RX_DROP;
break;
}
return ret;