Skip to contentSkip to conversation

net: sundance: balance PCI enable on cleanup

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: sundance: balance PCI enable on cleanup

sundance_probe1() enables the PCI device, but subsequent failure paths and sundance_remove1() never release the enable reference.

Use pcim_enable_device() to disable the device after existing network, DMA, mapping and region cleanup on probe failure or driver detach.

The imbalance is already present in the initial Git import.

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/ethernet/dlink/sundance.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/dlink/sundance.c +1 -1
@@ -510,7 +510,7 @@
 	int phy, phy_end, phy_idx = 0;
 	__le16 addr[ETH_ALEN / 2];
 
-	if (pci_enable_device(pdev))
+	if (pcim_enable_device(pdev))
 		return -EIO;
 	pci_set_master(pdev);
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Myeonghun Pak

sundance_probe1() enables the PCI device, but subsequent failure paths and sundance_remove1() never release the enable reference.

Use pcim_enable_device() to disable the device after existing network, DMA, mapping and region cleanup on probe failure or driver detach.

The imbalance is already present in the initial Git import.

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/ethernet/dlink/sundance.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

drivers/net/ethernet/dlink/sundance.c line 516

Quoted 8 lines
drivers/net/ethernet/dlink/sundance.c +1 -1
@@ -510,7 +510,7 @@
 	int phy, phy_end, phy_idx = 0;
 	__le16 addr[ETH_ALEN / 2];
 
-	if (pci_enable_device(pdev))
+	if (pcim_enable_device(pdev))
 		return -EIO;
 	pci_set_master(pdev);
 

Thanks

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

Subject: [PATCH net] net: sundance: balance PCI enable on cleanup

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