media: tw68: balance PCI enable on cleanup
Subsystems (3)
PATCH 1/1 media: tw68: balance PCI enable on cleanup
tw68_initdev() leaves the PCI device enabled after a later probe failure or tw68_finidev(). Use pcim_enable_device() to balance the enable reference when the driver is detached or probe fails.
The managed disable runs after the managed IRQ has been released.
This issue was identified during our ongoing static-analysis research while reviewing kernel code.
Fixes e15d1c12c587 ("[media] tw68: refactor and cleanup the tw68 driver")
Assisted-by LLM
Co-developed-by Ijae Kim <[email protected]>
Signed-off-by Ijae Kim <[email protected]>
Signed-off-by Myeonghun Pak <[email protected]>
--- drivers/media/pci/tw68/tw68-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/tw68/tw68-core.c +1 -1
@@ -228,7 +228,7 @@/* pci init */ dev->pci = pci_dev; -if (pci_enable_device (pci_dev)) { +if (pcim_enable_device (pci_dev)) { err = -EIO ; goto fail1; }