Commit 6fefb65e authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

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: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3767546c
...@@ -6992,9 +6992,14 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx) ...@@ -6992,9 +6992,14 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
int rc; int rc;
rc = bnx2_alloc_mem(bp); rc = bnx2_alloc_mem(bp);
if (rc) if (!rc)
rc = bnx2_init_nic(bp, 0);
if (rc) {
bnx2_napi_enable(bp);
dev_close(bp->dev);
return rc; return rc;
bnx2_init_nic(bp, 0); }
bnx2_netif_start(bp); bnx2_netif_start(bp);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment