Skip to contentSkip to conversation

EDAC/ie31200: Disable PCI device when probing fails

PATCH Applied Myeonghun Pak 3 participants 5 messages Sep 13 – Sep 17

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 OpenAI:GPT-5.6
---
 drivers/edac/ie31200_edac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/edac/ie31200_edac.c +3 -1
index 6f5fdf43e7732cd23d54dc8392caed4ca7990fcd..88af77ee07fe367f692a89dd55f188aefe912e44 100644
@@ -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;
maintainer Applied
#1 lore raw
Quoted 4 lines

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.

Quoted 8 lines

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 OpenAI:GPT-5.6

I added "LLM" to this tag based on current guidance in Documentation/process/coding-assistants.rst

Quoted 3 lines

Applied. Thanks.

-Tony

maintainer
#2 lore raw
Quoted 3 lines · Tony
Quoted 1 line
Assisted-by OpenAI:GPT-5.6

I added "LLM" to this tag based on current guidance in Documentation/process/coding-assistants.rst

Nah, it needs to be only LLM:

"Assisted-by: LLM"

because

commit 816d9992d9ed434ec52cfbd63080d518e535a41b

Author: Christian Brauner <[email protected]>
Date:   Wed Jul 1 17:54:48 2026 +0200

coding-assistants: simplify attribution

The requirement to identify specific models used in the Assisted-by tag provides free advertising to proprietary software companies while adding little or no useful information. Change the requirement to simply:

Assisted-by LLM

to capture the fact that an LLM was used without tracking which one.

Lemme fix it up.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#3 lore raw

Thanks, Tony and Boris, for applying the patch and fixing the tag. I'll use "Assisted-by: LLM" in future submissions.

Best regards,
Myeonghun Pak

2026년 9월 14일 (월) 오후 8:53, Borislav Petkov <[email protected]>님이 작성:

Quoted 33 lines · Tony
Quoted 3 lines
Quoted 1 line
Assisted-by OpenAI:GPT-5.6

I added "LLM" to this tag based on current guidance in Documentation/process/coding-assistants.rst

Nah, it needs to be only LLM:

"Assisted-by: LLM"

because

commit 816d9992d9ed434ec52cfbd63080d518e535a41b

Author: Christian Brauner <[email protected]>
Date:   Wed Jul 1 17:54:48 2026 +0200

coding-assistants: simplify attribution

The requirement to identify specific models used in the Assisted-by tag provides free advertising to proprietary software companies while adding little or no useful information. Change the requirement to simply:

Assisted-by LLM

to capture the fact that an LLM was used without tracking which one.

Lemme fix it up.

--
Regards/Gruss,
Boris.

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

maintainer
#4 lore raw
Quoted 2 lines · Myeonghun Pak

Thanks, Tony and Boris, for applying the patch and fixing the tag. I'll use "Assisted-by: LLM" in future submissions.

Also, for the future, do not top-post when replying on a public ML but put your reply underneath the text you're replying to, like I just did.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

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