linux/drivers/net/ethernet/broadcom/bnx2x
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_cmn.c bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails. 2012-02-07 13:13:33 -05:00
bnx2x_cmn.h bnx2x: properly initialize L5 features 2011-12-08 19:58:35 -05:00
bnx2x_dcb.c bnx2x: DCBX: use #define instead of magic 2011-11-13 16:03:54 -05:00
bnx2x_dcb.h bnx2x: DCBX: use #define instead of magic 2011-11-13 16:03:54 -05:00
bnx2x_dump.h
bnx2x_ethtool.c bnx2x: fix Big-Endianess in ethtool -t 2012-01-23 13:58:18 -05:00
bnx2x_fw_defs.h
bnx2x_fw_file_hdr.h
bnx2x_hsi.h bnx2x, cnic: support DRV_INFO upon FW request 2011-12-06 13:06:05 -05:00
bnx2x_init_ops.h
bnx2x_init.h
bnx2x_link.c bnx2x: Disable AN KR work-around for BCM57810 2012-01-17 10:44:43 -05:00
bnx2x_link.h bnx2x: ETS changes 2011-11-28 19:02:22 -05:00
bnx2x_main.c bnx2x: fix compilation error with SOE in fw_dump 2012-01-23 13:58:19 -05:00
bnx2x_reg.h bnx2x: Fix PFC setting on BCM57840 2012-01-17 10:44:43 -05:00
bnx2x_sp.c bnx2x: credit-leakage fixup on vlan_mac_del_all 2012-01-23 13:58:18 -05:00
bnx2x_sp.h bnx2x: credit-leakage fixup on vlan_mac_del_all 2012-01-23 13:58:18 -05:00
bnx2x_stats.c bnx2x, cnic: support DRV_INFO upon FW request 2011-12-06 13:06:05 -05:00
bnx2x_stats.h bnx2x: add PFC statistics 2011-12-06 13:06:04 -05:00
bnx2x.h bnx2x, cnic: support DRV_INFO upon FW request 2011-12-06 13:06:05 -05:00
Makefile