public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] PCI: brcmstb: Add missing if statement
@ 2020-09-21 20:45 Alex Dewar
  2020-09-21 20:56 ` Jim Quinlan
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Dewar @ 2020-09-21 20:45 UTC (permalink / raw)
  Cc: linux-arm-kernel, Rob Herring, Lorenzo Pieralisi, Alex Dewar,
	linux-pci, linux-kernel, Florian Fainelli,
	bcm-kernel-feedback-list, linux-rpi-kernel, Bjorn Helgaas,
	Jim Quinlan, Nicolas Saenz Julienne

brcm_pcie_resume() contains a return statement that was presumably
intended to have an "if (ret)" in front of it, otherwise the function
returns prematurely. Fix this.

I don't know if this code was tested or not, but I assume that this bug
means that this driver will not resume properly.

Fixes: ad3d29c77e1e ("PCI: brcmstb: Add control of rescal reset")
Addresses-Coverity: CID 1497099: Control flow issues (UNREACHABLE)
Signed-off-by: Alex Dewar <a.dewar@sussex.ac.uk>
---
 drivers/pci/controller/pcie-brcmstb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
index 7a3ff4632e7c..cb0c11b7308e 100644
--- a/drivers/pci/controller/pcie-brcmstb.c
+++ b/drivers/pci/controller/pcie-brcmstb.c
@@ -1154,6 +1154,7 @@ static int brcm_pcie_resume(struct device *dev)
 	clk_prepare_enable(pcie->clk);
 
 	ret = brcm_phy_start(pcie);
+	if (ret)
 		return ret;
 
 	/* Take bridge out of reset so we can access the SERDES reg */
-- 
2.28.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-23  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-21 20:45 [PATCH] PCI: brcmstb: Add missing if statement Alex Dewar
2020-09-21 20:56 ` Jim Quinlan
2020-09-21 21:16   ` [PATCH v2] PCI: brcmstb: Add missing if statement and error path Alex Dewar
2020-09-21 21:21     ` Florian Fainelli
2020-09-23  8:20     ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox