Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()

In case of error, the function devm_ioremap_resource() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: John Crispin <blogic@openwrt.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12451/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Wei Yongjun and committed by
Ralf Baechle
aaa0bf22 3af5a67c

+4 -4
+4 -4
arch/mips/pci/pci-mt7620.c
··· 297 297 return PTR_ERR(rstpcie0); 298 298 299 299 bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res); 300 - if (!bridge_base) 301 - return -ENOMEM; 300 + if (IS_ERR(bridge_base)) 301 + return PTR_ERR(bridge_base); 302 302 303 303 pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res); 304 - if (!pcie_base) 305 - return -ENOMEM; 304 + if (IS_ERR(pcie_base)) 305 + return PTR_ERR(pcie_base); 306 306 307 307 iomem_resource.start = 0; 308 308 iomem_resource.end = ~0;