Commit f6824308 authored by Vasundhara Volam's avatar Vasundhara Volam Committed by Jakub Kicinski

bnxt_en: Avoid disabling pci device in bnxt_remove_one() for already disabled device.

With the recently added error recovery logic, the device may already
be disabled if the firmware recovery is unsuccessful.  In
bnxt_remove_one(), check that the device is still enabled first
before calling pci_disable_device().

Fixes: 3bc7d4a3 ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
Signed-off-by: default avatarVasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
parent f255ed1c
...@@ -10382,7 +10382,8 @@ static void bnxt_cleanup_pci(struct bnxt *bp) ...@@ -10382,7 +10382,8 @@ static void bnxt_cleanup_pci(struct bnxt *bp)
{ {
bnxt_unmap_bars(bp, bp->pdev); bnxt_unmap_bars(bp, bp->pdev);
pci_release_regions(bp->pdev); pci_release_regions(bp->pdev);
pci_disable_device(bp->pdev); if (pci_is_enabled(bp->pdev))
pci_disable_device(bp->pdev);
} }
static void bnxt_init_dflt_coal(struct bnxt *bp) static void bnxt_init_dflt_coal(struct bnxt *bp)
......
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