All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR()
@ 2017-10-17 12:11 Wei Yongjun
  2017-10-17 16:22 ` Linus Walleij
  2017-10-20 23:03 ` Bjorn Helgaas
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2017-10-17 12:11 UTC (permalink / raw)
  To: Bjorn Helgaas, Sergei Shtylyov, Linus Walleij, Lorenzo Pieralisi,
	Marc Gonzalez, Brian Norris
  Cc: Wei Yongjun, linux-pci

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");

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

* Re: [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR()
  2017-10-17 12:11 [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
@ 2017-10-17 16:22 ` Linus Walleij
  2017-10-20 23:03 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2017-10-17 16:22 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Bjorn Helgaas, Sergei Shtylyov, Lorenzo Pieralisi, Marc Gonzalez,
	Brian Norris, linux-pci

On Tue, Oct 17, 2017 at 2:11 PM, Wei Yongjun <weiyongjun1@huawei.com> wrote:

> 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>

Whoops, thanks!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR()
  2017-10-17 12:11 [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
  2017-10-17 16:22 ` Linus Walleij
@ 2017-10-20 23:03 ` Bjorn Helgaas
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2017-10-20 23:03 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Bjorn Helgaas, Sergei Shtylyov, Linus Walleij, Lorenzo Pieralisi,
	Marc Gonzalez, Brian Norris, linux-pci

On Tue, Oct 17, 2017 at 12:11:03PM +0000, Wei Yongjun wrote:
> 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>

Applied with Linus' reviewed-by to pci/host-faraday for v4.15, thanks!

> ---
>  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");
> 

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

end of thread, other threads:[~2017-10-20 23:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 12:11 [PATCH -next] PCI: faraday: Fix wrong pointer passed to PTR_ERR() Wei Yongjun
2017-10-17 16:22 ` Linus Walleij
2017-10-20 23:03 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.