[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201001151821.27575-1-james.quinlan@broadcom.com>
Date: Thu, 1 Oct 2020 11:18:21 -0400
From: Jim Quinlan <james.quinlan@...adcom.com>
To: Dan Carpenter <dan.carpenter@...cle.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
bcm-kernel-feedback-list@...adcom.com, james.quinlan@...adcom.com
Cc: Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Jim Quinlan <jquinlan@...adcom.com>,
linux-rpi-kernel@...ts.infradead.org (moderated list:BROADCOM
BCM2711/BCM2835 ARM ARCHITECTURE),
linux-arm-kernel@...ts.infradead.org (moderated list:BROADCOM
BCM2711/BCM2835 ARM ARCHITECTURE),
linux-pci@...r.kernel.org (open list:PCI NATIVE HOST BRIDGE AND
ENDPOINT DRIVERS), linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v1] PCI: brcmstb: fix error return paths in probe()
Fixes two cases where we were returning without calling
clk_disable_unprepare(). Although there is a common place to go on probe()
errors (the 'fail' label), one can only jump there after executing
brcm_pcie_setup(), so we have to add clk_disable_unprepare() calls to the
two error paths.
Fixes: b98f52bc6495 ("PCI: brcmstb: Add control of rescal reset")
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Jim Quinlan <james.quinlan@...adcom.com>
---
drivers/pci/controller/pcie-brcmstb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 6e7aa82a54a3..da2fefe80d47 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1269,8 +1269,10 @@ static int brcm_pcie_probe(struct platform_device *pdev)
return ret;
}
pcie->rescal = devm_reset_control_get_optional_shared(&pdev->dev, "rescal");
- if (IS_ERR(pcie->rescal))
+ if (IS_ERR(pcie->rescal)) {
+ clk_disable_unprepare(pcie->clk);
return PTR_ERR(pcie->rescal);
+ }
ret = reset_control_deassert(pcie->rescal);
if (ret)
@@ -1279,6 +1281,7 @@ static int brcm_pcie_probe(struct platform_device *pdev)
ret = brcm_phy_start(pcie);
if (ret) {
reset_control_assert(pcie->rescal);
+ clk_disable_unprepare(pcie->clk);
return ret;
}
--
2.17.1
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4167 bytes)
Powered by blists - more mailing lists