summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/tg3.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-09-23 10:06:08 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-09-23 10:06:08 -0400
commit69604fe76e58c9d195e48b41d019b07fc27ce9d7 (patch)
treec9d1e7cfe406a8f168c3aceaf989eea0275d3045 /drivers/net/ethernet/broadcom/tg3.c
parent50b2d49bafa16e6311ab2da82f5aafc5f9ada99b (diff)
parent189e7d876e48d7c791fe1c9c01516f70f5621a9f (diff)
downloadlwn-69604fe76e58c9d195e48b41d019b07fc27ce9d7.tar.gz
lwn-69604fe76e58c9d195e48b41d019b07fc27ce9d7.zip
Merge tag 'kvm-s390-master-6.0-2' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
More pci fixes Fix for a code analyser warning
Diffstat (limited to 'drivers/net/ethernet/broadcom/tg3.c')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index db1e9d810b41..89889d8150da 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -18076,16 +18076,20 @@ static void tg3_shutdown(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata(pdev);
struct tg3 *tp = netdev_priv(dev);
+ tg3_reset_task_cancel(tp);
+
rtnl_lock();
+
netif_device_detach(dev);
if (netif_running(dev))
dev_close(dev);
- if (system_state == SYSTEM_POWER_OFF)
- tg3_power_down(tp);
+ tg3_power_down(tp);
rtnl_unlock();
+
+ pci_disable_device(pdev);
}
/**