PCI: brcmstb: fix error return paths in probe()
Subsystems (5)
PATCH 1/1 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.
--- drivers/pci/controller/pcie-brcmstb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-brcmstb.c +4 -1
@@ -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; }
Signature · 1 line
2.17.1
Quoted 10 lines · Jim Quinlan
Fixes two cases where we were returning without calling
clk_disable_unprepare(). Although there is a common place to go onprobe()errors (the 'fail' label), one can only jump there after executingbrcm_pcie_setup(), so we have to addclk_disable_unprepare()calls to the two error paths.Fixes b98f52bc6495 ("PCI: brcmstb: Add control of rescal reset")Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Jim Quinlan <[email protected]>
Signature · 1 line
Florian
Quoted 11 lines · Jim Quinlan
Fixes two cases where we were returning without calling
clk_disable_unprepare(). Although there is a common place to go onprobe()errors (the 'fail' label), one can only jump there after executingbrcm_pcie_setup(), so we have to addclk_disable_unprepare()calls to the two error paths.Fixes b98f52bc6495 ("PCI: brcmstb: Add control of rescal reset")Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Signed-off-by Jim Quinlan <[email protected]>---
Thanks!