Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1328305
| From | weiyj_lk@163.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() |
| Date | 2016-02-06 15:30 +0100 |
| Message-ID | <qZc25-8te-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn> 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> --- arch/mips/pci/pci-mt7620.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips/pci/pci-mt7620.c b/arch/mips/pci/pci-mt7620.c index a009ee4..044c1cd 100644 --- a/arch/mips/pci/pci-mt7620.c +++ b/arch/mips/pci/pci-mt7620.c @@ -297,12 +297,12 @@ static int mt7620_pci_probe(struct platform_device *pdev) return PTR_ERR(rstpcie0); bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res); - if (!bridge_base) - return -ENOMEM; + if (IS_ERR(bridge_base)) + return PTR_ERR(bridge_base); pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res); - if (!pcie_base) - return -ENOMEM; + if (IS_ERR(pcie_base)) + return PTR_ERR(pcie_base); iomem_resource.start = 0; iomem_resource.end = ~0;
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() weiyj_lk@163.com - 2016-02-06 15:30 +0100 Re: [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() John Crispin <blogic@openwrt.org> - 2016-02-06 16:50 +0100
csiph-web