bnx2x: NIC load failure cleanup
Load failures were not handled correctly Signed-off-by: Yitchak Gertner <gertner@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3cdf1db7db
commit
d101463499
@@ -6341,7 +6341,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||||||
rc = bnx2x_init_hw(bp, load_code);
|
rc = bnx2x_init_hw(bp, load_code);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
BNX2X_ERR("HW init failed, aborting\n");
|
BNX2X_ERR("HW init failed, aborting\n");
|
||||||
goto load_error;
|
goto load_int_disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup NIC internals and enable interrupts */
|
/* Setup NIC internals and enable interrupts */
|
||||||
@@ -6353,7 +6353,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||||||
if (!load_code) {
|
if (!load_code) {
|
||||||
BNX2X_ERR("MCP response failure, aborting\n");
|
BNX2X_ERR("MCP response failure, aborting\n");
|
||||||
rc = -EBUSY;
|
rc = -EBUSY;
|
||||||
goto load_int_disable;
|
goto load_rings_free;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6372,7 +6372,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||||||
rc = bnx2x_setup_leading(bp);
|
rc = bnx2x_setup_leading(bp);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
BNX2X_ERR("Setup leading failed!\n");
|
BNX2X_ERR("Setup leading failed!\n");
|
||||||
goto load_stop_netif;
|
goto load_netif_stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHIP_IS_E1H(bp))
|
if (CHIP_IS_E1H(bp))
|
||||||
@@ -6385,7 +6385,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||||||
for_each_nondefault_queue(bp, i) {
|
for_each_nondefault_queue(bp, i) {
|
||||||
rc = bnx2x_setup_multi(bp, i);
|
rc = bnx2x_setup_multi(bp, i);
|
||||||
if (rc)
|
if (rc)
|
||||||
goto load_stop_netif;
|
goto load_netif_stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CHIP_IS_E1(bp))
|
if (CHIP_IS_E1(bp))
|
||||||
@@ -6430,20 +6430,18 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
load_stop_netif:
|
load_netif_stop:
|
||||||
for_each_queue(bp, i)
|
for_each_queue(bp, i)
|
||||||
napi_disable(&bnx2x_fp(bp, i, napi));
|
napi_disable(&bnx2x_fp(bp, i, napi));
|
||||||
|
load_rings_free:
|
||||||
load_int_disable:
|
|
||||||
bnx2x_int_disable_sync(bp);
|
|
||||||
|
|
||||||
/* Release IRQs */
|
|
||||||
bnx2x_free_irq(bp);
|
|
||||||
|
|
||||||
/* Free SKBs, SGEs, TPA pool and driver internals */
|
/* Free SKBs, SGEs, TPA pool and driver internals */
|
||||||
bnx2x_free_skbs(bp);
|
bnx2x_free_skbs(bp);
|
||||||
for_each_queue(bp, i)
|
for_each_queue(bp, i)
|
||||||
bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
|
bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
|
||||||
|
load_int_disable:
|
||||||
|
bnx2x_int_disable_sync(bp);
|
||||||
|
/* Release IRQs */
|
||||||
|
bnx2x_free_irq(bp);
|
||||||
load_error:
|
load_error:
|
||||||
bnx2x_free_mem(bp);
|
bnx2x_free_mem(bp);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user