aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x_main.c
diff options
context:
space:
mode:
authorYitchak Gertner <gertner@broadcom.com>2008-08-25 18:25:45 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-25 18:25:45 -0400
commitd101463499b769d04e37d3bcb0e0c6876780ce08 (patch)
treef585c16f7fa0f12d4987e81e4b935b9a29912059 /drivers/net/bnx2x_main.c
parent3cdf1db7db1649771d683b6ba323ff604ea3cc5e (diff)
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>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r--drivers/net/bnx2x_main.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index 398daeb5be90..1c81da45f691 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -6341,7 +6341,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6341 rc = bnx2x_init_hw(bp, load_code); 6341 rc = bnx2x_init_hw(bp, load_code);
6342 if (rc) { 6342 if (rc) {
6343 BNX2X_ERR("HW init failed, aborting\n"); 6343 BNX2X_ERR("HW init failed, aborting\n");
6344 goto load_error; 6344 goto load_int_disable;
6345 } 6345 }
6346 6346
6347 /* Setup NIC internals and enable interrupts */ 6347 /* Setup NIC internals and enable interrupts */
@@ -6353,7 +6353,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6353 if (!load_code) { 6353 if (!load_code) {
6354 BNX2X_ERR("MCP response failure, aborting\n"); 6354 BNX2X_ERR("MCP response failure, aborting\n");
6355 rc = -EBUSY; 6355 rc = -EBUSY;
6356 goto load_int_disable; 6356 goto load_rings_free;
6357 } 6357 }
6358 } 6358 }
6359 6359
@@ -6372,7 +6372,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6372 rc = bnx2x_setup_leading(bp); 6372 rc = bnx2x_setup_leading(bp);
6373 if (rc) { 6373 if (rc) {
6374 BNX2X_ERR("Setup leading failed!\n"); 6374 BNX2X_ERR("Setup leading failed!\n");
6375 goto load_stop_netif; 6375 goto load_netif_stop;
6376 } 6376 }
6377 6377
6378 if (CHIP_IS_E1H(bp)) 6378 if (CHIP_IS_E1H(bp))
@@ -6385,7 +6385,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6385 for_each_nondefault_queue(bp, i) { 6385 for_each_nondefault_queue(bp, i) {
6386 rc = bnx2x_setup_multi(bp, i); 6386 rc = bnx2x_setup_multi(bp, i);
6387 if (rc) 6387 if (rc)
6388 goto load_stop_netif; 6388 goto load_netif_stop;
6389 } 6389 }
6390 6390
6391 if (CHIP_IS_E1(bp)) 6391 if (CHIP_IS_E1(bp))
@@ -6430,20 +6430,18 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
6430 6430
6431 return 0; 6431 return 0;
6432 6432
6433load_stop_netif: 6433load_netif_stop:
6434 for_each_queue(bp, i) 6434 for_each_queue(bp, i)
6435 napi_disable(&bnx2x_fp(bp, i, napi)); 6435 napi_disable(&bnx2x_fp(bp, i, napi));
6436 6436load_rings_free:
6437load_int_disable:
6438 bnx2x_int_disable_sync(bp);
6439
6440 /* Release IRQs */
6441 bnx2x_free_irq(bp);
6442
6443 /* Free SKBs, SGEs, TPA pool and driver internals */ 6437 /* Free SKBs, SGEs, TPA pool and driver internals */
6444 bnx2x_free_skbs(bp); 6438 bnx2x_free_skbs(bp);
6445 for_each_queue(bp, i) 6439 for_each_queue(bp, i)
6446 bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); 6440 bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
6441load_int_disable:
6442 bnx2x_int_disable_sync(bp);
6443 /* Release IRQs */
6444 bnx2x_free_irq(bp);
6447load_error: 6445load_error:
6448 bnx2x_free_mem(bp); 6446 bnx2x_free_mem(bp);
6449 6447