[PATCH] fix: drivers/usb/cdns3: cdnsp_pci_probe: missing pci_dev_put for func on success path
From: WenTao Liang
Date: Fri Jun 26 2026 - 23:02:20 EST
In cdnsp_pci_probe(), cdnsp_get_second_fun() acquires a reference on func
via pci_get_device(). All error paths correctly jump to put_pci label
which calls pci_dev_put(func). However, the success path returns 0
directly without releasing the func reference, leaking it.
Add pci_dev_put(func) before returning 0 on the success path.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: 3d82904559f4 ("usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver")
Signed-off-by: WenTao Liang <vulab@xxxxxxxxxxx>
---
drivers/usb/cdns3/cdnsp-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/cdns3/cdnsp-pci.c b/drivers/usb/cdns3/cdnsp-pci.c
index 566d94e49102..9c0feaec282d 100644
--- a/drivers/usb/cdns3/cdnsp-pci.c
+++ b/drivers/usb/cdns3/cdnsp-pci.c
@@ -162,6 +162,7 @@ static int cdnsp_pci_probe(struct pci_dev *pdev,
if (pci_dev_run_wake(pdev))
pm_runtime_put_noidle(&pdev->dev);
+ pci_dev_put(func);
return 0;
free_cdnsp:
--
2.39.5 (Apple Git-154)