Skip to contentSkip to conversation

media: marvell-cam: fix missing pci_disable_device() on remove

PATCH New Guangshuo Li 1 participant 1 message Apr 17

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

PATCH v2 1/1 media: marvell-cam: fix missing pci_disable_device() on remove

During manual code audit, we found that cafe_pci_probe() enables the PCI device with pci_enable_device(), and its probe error path properly calls pci_disable_device() on failure.

However, cafe_pci_remove() tears down the controller and frees the driver data without disabling the PCI device, leaving the remove path inconsistent with probe cleanup.

Add the missing pci_disable_device() call to cafe_pci_remove().

Fixes abfa3df36c01 ("[media] marvell-cam: Separate out the Marvell camera core")

---
v2:
- Fix subject prefix to use "media:" as reported by CI

 drivers/media/platform/marvell/cafe-driver.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/marvell/cafe-driver.c +1 -0
index 632c15572aa8..22034df6cba9 100644
@@ -609,6 +609,7 @@ static void cafe_pci_remove(struct pci_dev *pdev)
 		return;
 	}
 	cafe_shutdown(cam);
+	pci_disable_device(pdev);
 	kfree(cam);
 }
 
Signature · 1 line
2.43.0