[PATCH net 2/2] net: arcnet: com20020-pci: balance PCI enable on cleanup

From: Myeonghun Pak

Date: Mon Sep 14 2026 - 21:44:30 EST


com20020pci_probe() enables the PCI device, but neither its later failure
paths nor com20020pci_remove() release the enable reference. This
imbalance already exists in the initial Git import.

Use pcim_enable_device() so PCI is disabled after channel cleanup and
after managed LEDs and I/O regions have been released.

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

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
---
Depends on patch 1/2 to tear down registered channels before managed
PCI cleanup disables the device on probe failure.

drivers/net/arcnet/com20020-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/arcnet/com20020-pci.c b/drivers/net/arcnet/com20020-pci.c
--- a/drivers/net/arcnet/com20020-pci.c
+++ b/drivers/net/arcnet/com20020-pci.c
@@ -133,7 +133,7 @@ static int com20020pci_probe(struct pci_dev *pdev,

ret = 0;

- if (pci_enable_device(pdev))
+ if (pcim_enable_device(pdev))
return -EIO;

priv = devm_kzalloc(&pdev->dev, sizeof(struct com20020_priv),