Skip to contentSkip to conversation

net: wan: farsync: Disable PCI device on removal

PATCH In review Myeonghun Pak 3 participants 3 messages Sep 15 – Sep 17

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: wan: farsync: Disable PCI device on removal

fst_add_one() enables the PCI device and disables it on probe failures, but fst_remove_one() never releases the successful probe's enable reference. Disable the PCI device after the existing interrupt, tasklet, mapping and DMA cleanup has completed.

This issue is already present in the initial Git import; its pre-Git introduction is unknown.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by LLM
---
 drivers/net/wan/farsync.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wan/farsync.c +1 -0
index 6508c53..0ea6372 100644
@@ -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);
 }
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 26 lines · Myeonghun Pak

fst_add_one() enables the PCI device and disables it on probe failures, but fst_remove_one() never releases the successful probe's enable reference. Disable the PCI device after the existing interrupt, tasklet, mapping and DMA cleanup has completed.

This issue is already present in the initial Git import; its pre-Git introduction is unknown.

This issue was identified during our ongoing static-analysis research while reviewing kernel code.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Assisted-by LLM
---
 drivers/net/wan/farsync.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wan/farsync.c +0 -0
index 6508c53..0ea6372 100644

drivers/net/wan/farsync.c fst_remove_one(struct pci_dev *pdev) · line 2567

Quoted 7 lines
drivers/net/wan/farsync.c +1 -0
@@ -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);
 }
 

The patch looks good to me. By the way, the commit message could be a bit more concise.

Thanks

maintainer
#2 lore raw
In reply to Myeonghun Pak
Quoted 1 line · On Mon, 14 Sep 2026 21:59:40 -0400 Myeonghun Pak wrote:

Subject: [PATCH net] net: wan: farsync: Disable PCI device on removal

We're not fixing minor issues in orphaned drivers, sorry.