[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230422022019.7332-1-u202212057@hust.edu.cn>
Date: Fri, 21 Apr 2023 19:20:19 -0700
From: Huang Yuhao <u202212057@...t.edu.cn>
To: Vignesh Raghavendra <vigneshr@...com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Kishon Vijay Abraham I <kishon@...com>
Cc: Huang Yuhao <u202212057@...t.edu.cn>,
Dongliang Mu <dzm91@...t.edu.cn>, linux-omap@...r.kernel.org,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] PCI: dra7xx: Fix missing unwind goto in 'dra7xx_pcie_probe'
In dra7xx_pcie_probe, if dra7xx_pcie_enable_phy fails, it will directly
return without freeing the resources.
Fix this by changing the return statement to a goto statement.
Fixes: 1f6c4501c667 ("PCI: dra7xx: Group PHY API invocations")
Signed-off-by: Huang Yuhao <u202212057@...t.edu.cn>
Reviewed-by: Dongliang Mu <dzm91@...t.edu.cn>
---
This issue is found by static analyzer.
drivers/pci/controller/dwc/pci-dra7xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index 4ae807e7cf79..cc3cce0c5552 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -777,7 +777,7 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
ret = dra7xx_pcie_enable_phy(dra7xx);
if (ret) {
dev_err(dev, "failed to enable phy\n");
- return ret;
+ goto err_enable_phy;
}
platform_set_drvdata(pdev, dra7xx);
@@ -854,7 +854,7 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
pm_runtime_put(dev);
pm_runtime_disable(dev);
dra7xx_pcie_disable_phy(dra7xx);
-
+err_enable_phy:
err_link:
while (--i >= 0)
device_link_del(link[i]);
--
2.25.1
Powered by blists - more mailing lists