PCI: faraday: Fix wrong pointer passed to PTR_ERR()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 17 Oct 2017 12:11:03 +0000 (12:11 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 20 Oct 2017 23:02:46 +0000 (18:02 -0500)
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>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pci/host/pci-ftpci100.c

index 96028f01bc90142e50ef3b8ce5d85e6775f1e619..a19919c17d0406af65bbcd6aa76d81413873f2f6 100644 (file)
@@ -481,7 +481,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");