[PATCH 2/3] EDAC/i3000: Balance PCI device enablement
From: Myeonghun Pak
Date: Mon Sep 14 2026 - 22:00:49 EST
i3000_init_one() leaves the PCI enable reference held when probing fails
and when the controller is removed. Disable the device on probe failure
and after removing the EDAC controller. Keep explicit cleanup because
module initialization can call i3000_init_one() outside PCI driver binding.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: 535c6a53035d ("drivers/edac: new inte 30x0 MC driver")
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>
---
drivers/edac/i3000_edac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/edac/i3000_edac.c b/drivers/edac/i3000_edac.c
--- a/drivers/edac/i3000_edac.c
+++ b/drivers/edac/i3000_edac.c
@@ -461,6 +461,8 @@ static int i3000_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return -EIO;
rc = i3000_probe1(pdev, ent->driver_data);
+ if (rc)
+ pci_disable_device(pdev);
if (!mci_pdev)
mci_pdev = pci_dev_get(pdev);
@@ -480,7 +482,9 @@ static void i3000_remove_one(struct pci_dev *pdev)
if (!mci)
return;
edac_mc_free(mci);
+
+ pci_disable_device(pdev);
}
static const struct pci_device_id i3000_pci_tbl[] = {