mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: sungem: disable PCI device on remove
@ 2026-09-16  5:59 Guangshuo Li
  2026-09-16 10:33 ` Loktionov, Aleksandr
  2026-09-17  9:01 ` netdev-bot+sashiko
  0 siblings, 2 replies; 3+ messages in thread
From: Guangshuo Li @ 2026-09-16  5:59 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Petr Machata, Aleksandr Loktionov, Jacob Keller,
	Jijie Shao, Uwe Kleine-König (The Capable Hub),
	Ruoyu Wang, Guangshuo Li, Jakub Raczynski, netdev, linux-kernel
  Cc: stable

gem_init_one() enables the PCI device with pci_enable_device().

The probe failure path balances this operation with
pci_disable_device(). However, after a successful probe,
gem_remove_one() releases the PCI resources and netdev without
disabling the PCI device.

Call pci_disable_device() during removal to balance the successful
pci_enable_device() call.

This issue was found by manual code inspection.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
 drivers/net/ethernet/sun/sungem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index dc5638d105db..6abf4d292802 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2806,6 +2806,7 @@ static void gem_remove_one(struct pci_dev *pdev)
 		iounmap(gp->regs);
 		pci_release_regions(pdev);
 		free_netdev(dev);
+		pci_disable_device(pdev);
 	}
 }
 
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-17  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16  5:59 [PATCH] net: sungem: disable PCI device on remove Guangshuo Li
2026-09-16 10:33 ` Loktionov, Aleksandr
2026-09-17  9:01 ` netdev-bot+sashiko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®