* [PATCH 0/3] EDAC: Balance PCI device enablement in three Intel drivers
@ 2026-09-15 1:55 Myeonghun Pak
2026-09-15 1:55 ` [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement Myeonghun Pak
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Myeonghun Pak @ 2026-09-15 1:55 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck; +Cc: linux-edac, linux-kernel, stable
These drivers leave PCI enable references held on probe failure or removal.
Use managed PCI enablement for e752x. Keep explicit cleanup for i3000
and x38 because their module initialization can invoke probe outside
PCI driver binding. Each patch is independent.
These issues were identified during our ongoing static-analysis research
while reviewing kernel code.
Assisted-by: LLM
Myeonghun Pak (3):
EDAC/e752x: Use managed PCI device enablement
EDAC/i3000: Balance PCI device enablement
EDAC/x38: Balance PCI device enablement
drivers/edac/e752x_edac.c | 2 +-
drivers/edac/i3000_edac.c | 4 ++++
drivers/edac/x38_edac.c | 4 ++++
3 files changed, 9 insertions(+), 1 deletion(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement
2026-09-15 1:55 [PATCH 0/3] EDAC: Balance PCI device enablement in three Intel drivers Myeonghun Pak
@ 2026-09-15 1:55 ` Myeonghun Pak
2026-09-15 1:55 ` [PATCH 2/3] EDAC/i3000: Balance " Myeonghun Pak
2026-09-15 1:55 ` [PATCH 3/3] EDAC/x38: " Myeonghun Pak
2 siblings, 0 replies; 4+ messages in thread
From: Myeonghun Pak @ 2026-09-15 1:55 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck; +Cc: linux-edac, linux-kernel, stable
e752x_init_one() enables the PCI device without balancing the enable
reference on probe failure or removal. Use pcim_enable_device() so the
PCI device is disabled after failed probing and after driver removal.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: 806c35f5057a ("[PATCH] EDAC: drivers for AMD 76x and Intel E750x, E752x")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
drivers/edac/e752x_edac.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/edac/e752x_edac.c b/drivers/edac/e752x_edac.c
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
@@ -1387,7 +1387,7 @@ static int e752x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
edac_dbg(0, "\n");
/* wake up and enable device */
- if (pci_enable_device(pdev) < 0)
+ if (pcim_enable_device(pdev) < 0)
return -EIO;
return e752x_probe1(pdev, ent->driver_data);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/3] EDAC/i3000: Balance PCI device enablement
2026-09-15 1:55 [PATCH 0/3] EDAC: Balance PCI device enablement in three Intel drivers Myeonghun Pak
2026-09-15 1:55 ` [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement Myeonghun Pak
@ 2026-09-15 1:55 ` Myeonghun Pak
2026-09-15 1:55 ` [PATCH 3/3] EDAC/x38: " Myeonghun Pak
2 siblings, 0 replies; 4+ messages in thread
From: Myeonghun Pak @ 2026-09-15 1:55 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck; +Cc: linux-edac, linux-kernel, stable
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@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
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[] = {
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3/3] EDAC/x38: Balance PCI device enablement
2026-09-15 1:55 [PATCH 0/3] EDAC: Balance PCI device enablement in three Intel drivers Myeonghun Pak
2026-09-15 1:55 ` [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement Myeonghun Pak
2026-09-15 1:55 ` [PATCH 2/3] EDAC/i3000: Balance " Myeonghun Pak
@ 2026-09-15 1:55 ` Myeonghun Pak
2 siblings, 0 replies; 4+ messages in thread
From: Myeonghun Pak @ 2026-09-15 1:55 UTC (permalink / raw)
To: Borislav Petkov, Tony Luck; +Cc: linux-edac, linux-kernel, stable
x38_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 x38_init_one() outside PCI driver binding.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: df8bc08c192f ("edac x38: new MC driver module")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
drivers/edac/x38_edac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -423,6 +423,8 @@ static int x38_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return -EIO;
rc = x38_probe1(pdev, ent->driver_data);
+ if (rc)
+ pci_disable_device(pdev);
if (!mci_pdev)
mci_pdev = pci_dev_get(pdev);
@@ -439,9 +441,11 @@ static void x38_remove_one(struct pci_dev *pdev)
if (!mci)
return;
iounmap(mci->pvt_info);
edac_mc_free(mci);
+
+ pci_disable_device(pdev);
}
static const struct pci_device_id x38_pci_tbl[] = {
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-15 1:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15 1:55 [PATCH 0/3] EDAC: Balance PCI device enablement in three Intel drivers Myeonghun Pak
2026-09-15 1:55 ` [PATCH 1/3] EDAC/e752x: Use managed PCI device enablement Myeonghun Pak
2026-09-15 1:55 ` [PATCH 2/3] EDAC/i3000: Balance " Myeonghun Pak
2026-09-15 1:55 ` [PATCH 3/3] EDAC/x38: " Myeonghun Pak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®