From: Wei Yongjun <weiyongjun1@huawei.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
Linus Walleij <linus.walleij@linaro.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Marc Gonzalez <marc_gonzalez@sigmadesigns.com>,
Brian Norris <briannorris@chromium.org>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, <linux-pci@vger.kernel.org>
Subject: [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR()
Date: Tue, 17 Oct 2017 12:11:03 +0000 [thread overview]
Message-ID: <1508242263-73684-1-git-send-email-weiyongjun1@huawei.com> (raw)
PTR_ERR should access the value just tested by IS_ERR, otherwise
the wrong error code will be returned.
Fixes: 2eeb02b28579 ("PCI: faraday: Add clock handling")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/pci/host/pci-ftpci100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c
index 06d9687..fae6bd1 100644
--- a/drivers/pci/host/pci-ftpci100.c
+++ b/drivers/pci/host/pci-ftpci100.c
@@ -463,7 +463,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
}
p->bus_clk = devm_clk_get(dev, "PCICLK");
if (IS_ERR(p->bus_clk))
- return PTR_ERR(clk);
+ return PTR_ERR(p->bus_clk);
ret = clk_prepare_enable(p->bus_clk);
if (ret) {
dev_err(dev, "could not prepare PCICLK\n");
next reply other threads:[~2017-10-17 12:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-17 12:11 Wei Yongjun [this message]
2017-10-17 16:22 ` [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR() Linus Walleij
2017-10-20 23:03 ` Bjorn Helgaas
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=1508242263-73684-1-git-send-email-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=bhelgaas@google.com \
--cc=briannorris@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc_gonzalez@sigmadesigns.com \
--cc=sergei.shtylyov@cogentembedded.com \
/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).