[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140805210704.GG2019@lukather>
Date: Tue, 5 Aug 2014 23:07:04 +0200
From: Maxime Ripard <maxime.ripard@...e-electrons.com>
To: Marc Zyngier <marc.zyngier@....com>
Cc: netdev@...r.kernel.org, linux-sunxi@...glegroups.com,
Stefan Roese <sr@...x.de>
Subject: Re: [PATCH] net: sun4i-emac: fix memory leak on bad packet
On Tue, Aug 05, 2014 at 04:44:39PM +0100, Marc Zyngier wrote:
> 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@...x.de>
> Cc: Maxime Ripard <maxime.ripard@...e-electrons.com>
> Cc: <stable@...r.kernel.org> # 3.11+
> Signed-off-by: Marc Zyngier <marc.zyngier@....com>
Acked-by: Maxime Ripard <maxime.ripard@...e-electrons.com>
Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists