linux/drivers/net/ethernet/broadcom
Jesper Juhl 3f61cd879c bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails.
We allocate memory for 'new_data' with kmalloc(). If we get the memory
we then try to build_skb() and if that should fail (which it can) we
do not enter 'if (likely(skb)) {' and actually use 'new_data' but
instead fall through to the 'drop:' label and end up returning from
the function without ever assigning 'new'data' to anything or freeing
it. That leaks the memory allocated to 'new_data'.

This patch fixes the memory leak by doing a kfree(new_data) in the
case where build_skb() fails (or where allocation of 'new_data' itself
fails, but in taht case it's just a harmless kfree(NULL)).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:13:33 -05:00
..
bnx2x bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails. 2012-02-07 13:13:33 -05:00
Kconfig
Makefile
b44.c b44: Use dev_kfree_skb_irq() in b44_tx() 2011-11-23 16:40:31 -05:00
b44.h
bcm63xx_enet.c bcm63xx_enet: use an unique MDIO bus name. 2012-01-10 16:35:02 -08:00
bcm63xx_enet.h
bnx2.c bnx2: Update driver to use new mips firmware. 2011-12-19 15:46:28 -05:00
bnx2.h bnx2: switch to build_skb() infrastructure 2011-11-18 02:04:47 -05:00
bnx2_fw.h
cnic.c cnic: Improve error recovery on bnx2x devices 2012-01-05 14:01:21 -05:00
cnic.h
cnic_defs.h cnic: Improve error recovery on bnx2x devices 2012-01-05 14:01:21 -05:00
cnic_if.h cnic: Improve error recovery on bnx2x devices 2012-01-05 14:01:21 -05:00
sb1250-mac.c sb1250: use an unique MDIO bus name. 2012-01-10 16:35:00 -08:00
tg3.c tg3: fix ipv6 header length computation 2012-01-23 14:25:01 -05:00
tg3.h tg3: Break out RSS indir table init and assignment 2011-12-15 13:09:11 -05:00