Skip to contentSkip to conversation

media: tw68: balance PCI enable on cleanup

PATCH New Myeonghun Pak 1 participant 1 message Sep 15

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

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
---
 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;
 	}