bnxt_en: don't disable an already disabled PCI device
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Sun, 18 Jul 2021 19:36:25 +0000 (15:36 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Jul 2021 12:35:39 +0000 (14:35 +0200)
commitab830c3bae192743635c13422ad00afc26716b08
tree61064924b49f8454f96fc5a504e9e9a9eb57f772
parent26463689445d24990a42da1d04f9df26bb76f792
bnxt_en: don't disable an already disabled PCI device

[ Upstream commit c81cfb6256d90ea5ba4a6fb280ea3b171be4e05c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c