PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 8 Apr 2021 07:24:02 +0000 (15:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:28:00 +0000 (12:28 +0200)
commit75420f9400a6792dc4b43e5a43ee0f105dd3f9ee
treebc715243051fa605b0d83bd670c7fc058d8bf95c
parentb6352e2e276469ce756e5d698ea95855535e62a4
PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()

[ Upstream commit 1e29cd9983eba1b596bc07f94d81d728007f8a25 ]

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>
drivers/pci/controller/pcie-rcar-ep.c