mtd: maps: pci: balance PCI enable on cleanup
Subsystems (2)
PATCH 1/1 mtd: maps: pci: balance PCI enable on cleanup
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.
--- drivers/mtd/maps/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/pci.c +1 -1
@@ -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;
Quoted 10 lines · Myeonghun Pak
mtd_pci_probe()leaves the PCI device enabled on later probe failure andmtd_pci_remove()does not disable it either. Usepcim_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