Skip to content

Commit 84a0a44

Browse files
dinghaoliupopcornmix
authored andcommitted
PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()
[ Upstream commit 1e29cd9 ] 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/20210408072402.15069-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6ca1378 commit 84a0a44

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎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)