From 68a3e57814dea71157450ed5fb96c5cf62da8435 Mon Sep 17 00:00:00 2001 From: Myeonghun Pak Date: Sun, 13 Sep 2026 17:25:00 -0400 Subject: [PATCH] EDAC/ie31200: Disable PCI device when probing fails ie31200_init_one() enables the PCI device before calling ie31200_probe1(). If probing fails, it returns without balancing the successful enable, leaving the PCI enable count elevated. Call pci_disable_device() on that failure path. This also covers the direct ie31200_init_one() call from the module initialization fallback, while preserving the existing return values and successful probe path. This issue was identified during our ongoing static-analysis research while reviewing kernel code. Assisted-by: LLM Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260913212500.60272-1-mhun512@gmail.com --- drivers/edac/ie31200_edac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/edac/ie31200_edac.c b/drivers/edac/ie31200_edac.c index 6f5fdf43e773..88af77ee07fe 100644 --- a/drivers/edac/ie31200_edac.c +++ b/drivers/edac/ie31200_edac.c @@ -660,7 +660,9 @@ static int ie31200_init_one(struct pci_dev *pdev, if (pci_enable_device(pdev) < 0) return -EIO; rc = ie31200_probe1(pdev, (struct res_config *)ent->driver_data); - if (rc == 0 && !mci_pdev) + if (rc) + pci_disable_device(pdev); + else if (!mci_pdev) mci_pdev = pci_dev_get(pdev); return rc;