forked from Minki/linux
bnx2: Cleanup error handling in bnx2_open().
All error handling in bnx2_open() can be consolidated. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5e9ad9e108
commit
2739a8bb5b
@ -5773,29 +5773,16 @@ bnx2_open(struct net_device *dev)
|
|||||||
bnx2_setup_int_mode(bp, disable_msi);
|
bnx2_setup_int_mode(bp, disable_msi);
|
||||||
bnx2_napi_enable(bp);
|
bnx2_napi_enable(bp);
|
||||||
rc = bnx2_alloc_mem(bp);
|
rc = bnx2_alloc_mem(bp);
|
||||||
if (rc) {
|
if (rc)
|
||||||
bnx2_napi_disable(bp);
|
goto open_err;
|
||||||
bnx2_free_mem(bp);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = bnx2_request_irq(bp);
|
rc = bnx2_request_irq(bp);
|
||||||
|
if (rc)
|
||||||
if (rc) {
|
goto open_err;
|
||||||
bnx2_napi_disable(bp);
|
|
||||||
bnx2_free_mem(bp);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = bnx2_init_nic(bp, 1);
|
rc = bnx2_init_nic(bp, 1);
|
||||||
|
if (rc)
|
||||||
if (rc) {
|
goto open_err;
|
||||||
bnx2_napi_disable(bp);
|
|
||||||
bnx2_free_irq(bp);
|
|
||||||
bnx2_free_skbs(bp);
|
|
||||||
bnx2_free_mem(bp);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
mod_timer(&bp->timer, jiffies + bp->current_interval);
|
mod_timer(&bp->timer, jiffies + bp->current_interval);
|
||||||
|
|
||||||
@ -5825,11 +5812,8 @@ bnx2_open(struct net_device *dev)
|
|||||||
rc = bnx2_request_irq(bp);
|
rc = bnx2_request_irq(bp);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
bnx2_napi_disable(bp);
|
|
||||||
bnx2_free_skbs(bp);
|
|
||||||
bnx2_free_mem(bp);
|
|
||||||
del_timer_sync(&bp->timer);
|
del_timer_sync(&bp->timer);
|
||||||
return rc;
|
goto open_err;
|
||||||
}
|
}
|
||||||
bnx2_enable_int(bp);
|
bnx2_enable_int(bp);
|
||||||
}
|
}
|
||||||
@ -5842,6 +5826,13 @@ bnx2_open(struct net_device *dev)
|
|||||||
netif_start_queue(dev);
|
netif_start_queue(dev);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
open_err:
|
||||||
|
bnx2_napi_disable(bp);
|
||||||
|
bnx2_free_skbs(bp);
|
||||||
|
bnx2_free_irq(bp);
|
||||||
|
bnx2_free_mem(bp);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user