summaryrefslogtreecommitdiff
path: root/net/ieee802154/reassembly.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2014-08-05 19:44:39 +0400
committerDavid S. Miller <davem@davemloft.net>2014-08-06 03:43:49 +0400
commit2670cc699a66c4cf268cb3e3f6dfc325ec14f224 (patch)
treee69774ecf0b2998732922d6c017f06d63dfdf157 /net/ieee802154/reassembly.c
parent757efd32d5ce31f67193cc0e6a56e4dffcc42fb1 (diff)
downloadlinux-2670cc699a66c4cf268cb3e3f6dfc325ec14f224.tar.xz
net: sun4i-emac: fix memory leak on bad packet
Upon reception of a new frame, the emac driver checks for a number of error conditions, and flag the packet as "bad" if any of these are present. It then allocates a skb unconditionally, but only uses it if the packet is "good". On the error path, the skb is just forgotten, and the system leaks memory. The piece of junk I have on my desk seems to encounter such error frequently enough so that the box goes OOM after a couple of days, which makes me grumpy. Fix this by moving the allocation on the "good_packet" path (and convert it to netdev_alloc_skb while we're at it). Tested on a random Allwinner A20 board. Cc: Stefan Roese <sr@denx.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: <stable@vger.kernel.org> # 3.11+ Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154/reassembly.c')
0 files changed, 0 insertions, 0 deletions