diff options
| author | Wei Yongjun <weiyongjun1@huawei.com> | 2018-01-03 02:33:35 -0500 |
|---|---|---|
| committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2018-01-03 06:31:53 -0500 |
| commit | c68febfd68e0f01d90da15bd10e94b42544f0f68 (patch) | |
| tree | bf63f5cfacbafdc8a5a7e79bfd6ac516db1fa345 | |
| parent | 83f4f3f63be2b2c4fc94e308a766859df2825f43 (diff) | |
PCI: dwc: artpec6: Fix return value check in artpec6_add_pcie_ep()
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>
| -rw-r--r-- | drivers/pci/dwc/pcie-artpec6.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/dwc/pcie-artpec6.c b/drivers/pci/dwc/pcie-artpec6.c index 312f21b6e013..b1e98205110f 100644 --- a/drivers/pci/dwc/pcie-artpec6.c +++ b/drivers/pci/dwc/pcie-artpec6.c | |||
| @@ -485,8 +485,8 @@ static int artpec6_add_pcie_ep(struct artpec6_pcie *artpec6_pcie, | |||
| 485 | 485 | ||
| 486 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi2"); | 486 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbi2"); |
| 487 | pci->dbi_base2 = devm_ioremap(dev, res->start, resource_size(res)); | 487 | pci->dbi_base2 = devm_ioremap(dev, res->start, resource_size(res)); |
| 488 | if (IS_ERR(pci->dbi_base2)) | 488 | if (!pci->dbi_base2) |
| 489 | return PTR_ERR(pci->dbi_base2); | 489 | return -ENOMEM; |
| 490 | 490 | ||
| 491 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); | 491 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); |
| 492 | if (!res) | 492 | if (!res) |
