aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2009-08-21 12:20:45 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-22 20:48:47 -0400
commit6fefb65e78f098c09d0ab877b2c70421e4c84116 (patch)
tree2b85b62679ee60f56fed3e86f96a91a33cbb25dd /drivers
parent3767546cc24de8f104e745d59a0a43a09d9267df (diff)
bnx2: Close device if MTU change or ring size change fails.
When unable to allocate memory for new MTU or new ring size, we need to close the device to prevent it from crashing. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/bnx2.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 9cfd46017e4e..1d502e6f6c9c 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -6992,9 +6992,14 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
6992 int rc; 6992 int rc;
6993 6993
6994 rc = bnx2_alloc_mem(bp); 6994 rc = bnx2_alloc_mem(bp);
6995 if (rc) 6995 if (!rc)
6996 rc = bnx2_init_nic(bp, 0);
6997
6998 if (rc) {
6999 bnx2_napi_enable(bp);
7000 dev_close(bp->dev);
6996 return rc; 7001 return rc;
6997 bnx2_init_nic(bp, 0); 7002 }
6998 bnx2_netif_start(bp); 7003 bnx2_netif_start(bp);
6999 } 7004 }
7000 return 0; 7005 return 0;