linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Quinlan <james.quinlan@broadcom.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	bcm-kernel-feedback-list@broadcom.com,
	james.quinlan@broadcom.com
Cc: Rob Herring <robh@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Jim Quinlan <jquinlan@broadcom.com>,
	linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM
	BCM2711/BCM2835 ARM ARCHITECTURE),
	linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM
	BCM2711/BCM2835 ARM ARCHITECTURE),
	linux-pci@vger.kernel.org (open list:PCI NATIVE HOST BRIDGE AND
	ENDPOINT DRIVERS), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v1] PCI: brcmstb: fix error return paths in probe()
Date: Thu,  1 Oct 2020 11:18:21 -0400	[thread overview]
Message-ID: <20201001151821.27575-1-james.quinlan@broadcom.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1435 bytes --]

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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jim Quinlan <james.quinlan@broadcom.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


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4167 bytes --]

             reply	other threads:[~2020-10-01 15:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 15:18 Jim Quinlan [this message]
2020-10-01 18:51 ` [PATCH v1] PCI: brcmstb: fix error return paths in probe() Florian Fainelli
2020-10-08  9:58 ` Nicolas Saenz Julienne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201001151821.27575-1-james.quinlan@broadcom.com \
    --to=james.quinlan@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bhelgaas@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=f.fainelli@gmail.com \
    --cc=jquinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).