[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200605031940.27911-1-navid.emamdoost@gmail.com>
Date: Thu, 4 Jun 2020 22:19:40 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: Kishon Vijay Abraham I <kishon@...com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
linux-omap@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: emamd001@....edu, wu000273@....edu, kjlu@....edu, smccaman@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>
Subject: [PATCH] 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.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/pci/controller/dwc/pci-dra7xx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 3b0e58f2de58..83986f5f2be7 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists