Skip to contentSkip to conversation

PCI: dwc: pci-dra7xx: handle failure case of pm_runtime_get_sync

PATCH New Navid Emamdoost 1 participant 1 message Jun 5, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: dwc: pci-dra7xx: handle failure case of pm_runtime_get_sync

Calling pm_runtime_get_sync increments the counter even in case of failure, causing incorrect ref count. Call pm_runtime_put if pm_runtime_get_sync fails.

---
 drivers/pci/controller/dwc/pci-dra7xx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/pci/controller/dwc/pci-dra7xx.c +1 -3
index 3b0e58f2de58..83986f5f2be7 100644
@@ -932,7 +932,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
 		dev_err(dev, "pm_runtime_get_sync failed\n");
-		goto err_get_sync;
+		goto err_gpio;
 	}
 
 	reset = devm_gpiod_get_optional(dev, NULL, GPIOD_OUT_HIGH);
@@ -1001,8 +1001,6 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 
 err_gpio:
 	pm_runtime_put(dev);
-
-err_get_sync:
 	pm_runtime_disable(dev);
 	dra7xx_pcie_disable_phy(dra7xx);
 
Signature · 1 line
2.17.1