PCI: dwc: artpec6: Fix return value check in artpec6_add_pcie_ep()
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 3 Jan 2018 07:33:35 +0000 (07:33 +0000)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 3 Jan 2018 11:31:53 +0000 (11:31 +0000)
In case of error, the function devm_ioremap() returns NULL pointer
not ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
drivers/pci/dwc/pcie-artpec6.c

index 312f21b6e01390d5cc966446515736d4f27c7eeb..b1e98205110fee50f4d101a0f1f86fbd31e0b534 100644 (file)
@@ -485,8 +485,8 @@ static int artpec6_add_pcie_ep(struct artpec6_pcie *artpec6_pcie,
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi2");
        pci->dbi_base2 = devm_ioremap(dev, res->start, resource_size(res));
-       if (IS_ERR(pci->dbi_base2))
-               return PTR_ERR(pci->dbi_base2);
+       if (!pci->dbi_base2)
+               return -ENOMEM;
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space");
        if (!res)