Re: [PATCH 2/3] EDAC/i3000: Balance PCI device enablement

From: Borislav Petkov

Date: Tue Sep 15 2026 - 21:20:28 EST


Tony,

I have recently started marking obsolete EDAC drivers as orphaned because,
well, they don't deserve the effort.

How about this one?

On Mon, Sep 14, 2026 at 09:55:18PM -0400, Myeonghun Pak wrote:
> 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[] = {

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette