* [PATCH] mtd: maps: pci: balance PCI enable on cleanup
@ 2026-09-15 1:06 Myeonghun Pak
2026-09-25 14:28 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-09-15 1:06 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
Cc: linux-mtd, linux-kernel, stable
mtd_pci_probe() leaves the PCI device enabled on later probe failure and
mtd_pci_remove() does not disable it either. Use pcim_enable_device() to
release the enable reference after the existing map and region cleanup.
The imbalance is already present in the initial Git import.
This issue was identified during our ongoing static-analysis research
while reviewing kernel code.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
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/mtd/maps/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/maps/pci.c b/drivers/mtd/maps/pci.c
--- a/drivers/mtd/maps/pci.c
+++ b/drivers/mtd/maps/pci.c
@@ -250,7 +250,7 @@
struct mtd_info *mtd = NULL;
int err;
- err = pci_enable_device(dev);
+ err = pcim_enable_device(dev);
if (err)
goto out;
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: maps: pci: balance PCI enable on cleanup
2026-09-15 1:06 [PATCH] mtd: maps: pci: balance PCI enable on cleanup Myeonghun Pak
@ 2026-09-25 14:28 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2026-09-25 14:28 UTC (permalink / raw)
To: Richard Weinberger, Vignesh Raghavendra, Myeonghun Pak
Cc: linux-mtd, linux-kernel, stable
On Mon, 14 Sep 2026 21:06:47 -0400, Myeonghun Pak wrote:
> mtd_pci_probe() leaves the PCI device enabled on later probe failure and
> mtd_pci_remove() does not disable it either. Use pcim_enable_device() to
> release the enable reference after the existing map and region cleanup.
>
> The imbalance is already present in the initial Git import.
>
> This issue was identified during our ongoing static-analysis research
> while reviewing kernel code.
>
> [...]
Applied to mtd/next, thanks!
[1/1] mtd: maps: pci: balance PCI enable on cleanup
commit: 3be16e5d4990bf96309ac5ba35cb369c6015bce7
Patche(s) should be available on mtd/linux.git and will be
part of the next PR (provided that no robot complains by then).
Kind regards,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-25 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 1:06 [PATCH] mtd: maps: pci: balance PCI enable on cleanup Myeonghun Pak
2026-09-25 14:28 ` Miquel Raynal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.