Thread (2 messages) flat view 2 messages, 2 authors, 5h ago
HOTtoday

[PATCH] net: wan: farsync: disable PCI device on removal

From: Guangshuo Li <hidden>
Date: 2026-09-16 06:31:27
Also in: lkml, stable
Subsystem: farsync synchronous driver, networking drivers, the rest · Maintainers: Kevin Curtis, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

fst_add_one() calls pci_enable_device() to enable the PCI device. The
probe failure paths call pci_disable_device() to release the matching
enable reference, but fst_remove_one() does not disable the device
after a successful probe.

As a result, the PCI device enable reference remains unbalanced after
the driver is removed.

Call pci_disable_device() after the existing interrupt, tasklet,
mapping, DMA and PCI region cleanup to release the enable reference.

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 <redacted>
---
 drivers/net/wan/farsync.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 6508c53bdc24..0ea637270ad7 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2561,6 +2561,7 @@ fst_remove_one(struct pci_dev *pdev)
 				  card->tx_dma_handle_card);
 	}
 	fst_card_array[card->card_no] = NULL;
+	pci_disable_device(pdev);
 	kfree(card);
 }
 
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help