Skip to content

Commit 1e29cd9

Browse files
dinghaoliuLorenzo Pieralisi
authored andcommitted
PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]>
1 parent e73f0f0 commit 1e29cd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/controller/pcie-rcar-ep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ static int rcar_pcie_ep_probe(struct platform_device *pdev)
492492
pcie->dev = dev;
493493

494494
pm_runtime_enable(dev);
495-
err = pm_runtime_get_sync(dev);
495+
err = pm_runtime_resume_and_get(dev);
496496
if (err < 0) {
497-
dev_err(dev, "pm_runtime_get_sync failed\n");
497+
dev_err(dev, "pm_runtime_resume_and_get failed\n");
498498
goto err_pm_disable;
499499
}
500500

0 commit comments

Comments
 (0)