diff mbox series

[-next] PCI: rcar: Fix PM reference leak in rcar_pcie_ep_probe()

Message ID 1621602354-109955-1-git-send-email-zou_wei@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Lorenzo Pieralisi
Headers show
Series [-next] PCI: rcar: Fix PM reference leak in rcar_pcie_ep_probe() | expand

Commit Message

Zou Wei May 21, 2021, 1:05 p.m. UTC
pm_runtime_get_sync will increment pm usage counter even it failed.
Forgetting to putting operation will result in reference leak here.
Fix it by replacing it with pm_runtime_resume_and_get to keep usage
counter balanced.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
 drivers/pci/controller/pcie-rcar-ep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c
index b4a288e..8a8c46c 100644
--- a/drivers/pci/controller/pcie-rcar-ep.c
+++ b/drivers/pci/controller/pcie-rcar-ep.c
@@ -492,7 +492,7 @@  static int rcar_pcie_ep_probe(struct platform_device *pdev)
 	pcie->dev = dev;
-	err = pm_runtime_get_sync(dev);
+	err = pm_runtime_resume_and_get(dev);
 	if (err < 0) {
 		dev_err(dev, "pm_runtime_get_sync failed\n");
 		goto err_pm_disable;