aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2021-04-08 15:24:02 +0800
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2021-08-05 14:08:57 +0100
commit1e29cd9983eba1b596bc07f94d81d728007f8a25 (patch)
tree9c5940b72c47fb6d67fe11604162c6dfa3ae3d61
parentLinux 5.14-rc1 (diff)
downloadwireguard-linux-1e29cd9983eba1b596bc07f94d81d728007f8a25.tar.xz
wireguard-linux-1e29cd9983eba1b596bc07f94d81d728007f8a25.zip
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/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>
-rw-r--r--drivers/pci/controller/pcie-rcar-ep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c
index b4a288e24aaf..c91d85b15129 100644
--- a/drivers/pci/controller/pcie-rcar-ep.c
+++ b/drivers/pci/controller/pcie-rcar-ep.c
@@ -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;
}