diff options
author | Kalesh AP <kalesh-anakkur.purayil@broadcom.com> | 2021-07-18 21:36:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-19 17:25:43 +0200 |
commit | c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c (patch) | |
tree | 75d732652c5cdbda72df2ed83a5db37aebbcd0f4 | |
parent | bonding: fix build issue (diff) | |
download | linux-c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c.tar.xz linux-c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c.zip |
bnxt_en: don't disable an already disabled PCI device
If device is already disabled in reset path and PCI io error is
detected before the device could be enabled, driver could
call pci_disable_device() for already disabled device. Fix this
problem by calling pci_disable_device() only if the device is already
enabled.
Fixes: 6316ea6db93d ("bnxt_en: Enable AER support.")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index f56245eeef7b..fdfb75a1608d 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -13436,7 +13436,8 @@ static pci_ers_result_t bnxt_io_error_detected(struct pci_dev *pdev, if (netif_running(netdev)) bnxt_close(netdev); - pci_disable_device(pdev); + if (pci_is_enabled(pdev)) + pci_disable_device(pdev); bnxt_free_ctx_mem(bp); kfree(bp->ctx); bp->ctx = NULL; |