Skip to contentSkip to conversation

PCI: rcar: Fix PM reference leak in rcar_pcie_ep_probe()

PATCH New Zou Wei 1 participant 1 message May 21, 2021

Subsystems (4)
lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 PCI: rcar: Fix PM reference leak in rcar_pcie_ep_probe()

pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced.

---
 drivers/pci/controller/pcie-rcar-ep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/pcie-rcar-ep.c +1 -1
index b4a288e..8a8c46c 100644
@@ -492,7 +492,7 @@ 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");
 		goto err_pm_disable;
Signature · 1 line
2.6.2