[net,v3,6/6] bnx2x: prevent crash in shutdown flow with CNIC

Submitted by Dmitry Kravkov on July 17, 2013, 10 p.m.


Message ID 1374098440-27877-7-git-send-email-dmitry@broadcom.com
State Changes Requested
Delegated to: David Miller
Headers show

Commit Message

Dmitry Kravkov July 17, 2013, 10 p.m.
From: Yuval Mintz <yuvalmin@broadcom.com>

There might be a crash as during shutdown flow CNIC might try
to access resources already freed by bnx2x.
Change bnx2x_close() into dev_close() in __bnx2x_remove (shutdown flow)
to guarantee CNIC is notified of the device's change of status.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 9394b7d..2fdc8e6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -12838,8 +12838,7 @@  static void __bnx2x_remove(struct pci_dev *pdev,
 	} else {
-		if (netif_running(dev))
-			bnx2x_close(dev);
+		dev_close(dev);