summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
diff options
context:
space:
mode:
authorYuval Mintz <yuvalmin@broadcom.com>2013-04-24 01:45:01 +0000
committerDavid S. Miller <davem@davemloft.net>2013-04-24 16:33:53 -0400
commit2f7a312230e0d24e8913e7eff7b24d34b7092fcd (patch)
tree36f7fba230c61646158a3277d27957b2184903df /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
parentf8f4f61a5a358841c5acf144f6fa13a6b475ec2c (diff)
downloadblackbird-op-linux-2f7a312230e0d24e8913e7eff7b24d34b7092fcd.tar.gz
blackbird-op-linux-2f7a312230e0d24e8913e7eff7b24d34b7092fcd.zip
bnx2x: Fix memory leak
There exists an `allocation race' between the CNIC and bnx2x drivers, in which both drivers allocate the same t2 memory while disregarding a possible previous allocation. Additionally, due to the current order of memory releases, some of the ILT memory in the driver is not released correctly when unloading the driver. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index e8ed78f64007..fd20a4ff0150 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2934,9 +2934,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link)
bnx2x_free_fp_mem_cnic(bp);
if (IS_PF(bp)) {
- bnx2x_free_mem(bp);
if (CNIC_LOADED(bp))
bnx2x_free_mem_cnic(bp);
+ bnx2x_free_mem(bp);
}
bp->state = BNX2X_STATE_CLOSED;
bp->cnic_loaded = false;
OpenPOWER on IntegriCloud