]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: marvell-cam: fix missing pci_disable_device() on remove
authorGuangshuo Li <lgs201920130244@gmail.com>
Fri, 17 Apr 2026 06:53:30 +0000 (14:53 +0800)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Tue, 5 May 2026 14:57:03 +0000 (16:57 +0200)
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")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/marvell/cafe-driver.c

index 632c15572aa8fe82a6cfb8b90c65a2e7bf8974a6..22034df6cba9643f27b322efa78ee3b8af42d58f 100644 (file)
@@ -609,6 +609,7 @@ static void cafe_pci_remove(struct pci_dev *pdev)
                return;
        }
        cafe_shutdown(cam);
+       pci_disable_device(pdev);
        kfree(cam);
 }