Skip to content

Commit

Permalink
PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dinghaoliu authored and Lorenzo Pieralisi committed Aug 5, 2021
1 parent e73f0f0 commit 1e29cd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/controller/pcie-rcar-ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@ static int rcar_pcie_ep_probe(struct platform_device *pdev)
pcie->dev = dev;

pm_runtime_enable(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");
dev_err(dev, "pm_runtime_resume_and_get failed\n");
goto err_pm_disable;
}

Expand Down

0 comments on commit 1e29cd9

Please sign in to comment.