From: weiyj_lk@163.com To: Ralf Baechle <ralf@linux-mips.org>, Matthias Brugger <matthias.bgg@gmail.com>, John Crispin <blogic@openwrt.org> Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>, linux-mips@linux-mips.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() Date: Sat, 6 Feb 2016 22:24:19 +0800 [thread overview] Message-ID: <1454768659-32720-1-git-send-email-weiyj_lk@163.com> (raw) 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;
WARNING: multiple messages have this Message-ID (diff)
From: weiyj_lk@163.com (weiyj_lk at 163.com) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() Date: Sat, 6 Feb 2016 22:24:19 +0800 [thread overview] Message-ID: <1454768659-32720-1-git-send-email-weiyj_lk@163.com> (raw) 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;
next reply other threads:[~2016-02-06 14:26 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-02-06 14:24 weiyj_lk [this message] 2016-02-06 14:24 ` [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe() weiyj_lk at 163.com 2016-02-06 15:40 ` John Crispin 2016-02-06 15:40 ` John Crispin 2016-02-10 9:01 ` Ralf Baechle 2016-02-10 9:01 ` Ralf Baechle
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1454768659-32720-1-git-send-email-weiyj_lk@163.com \ --to=weiyj_lk@163.com \ --cc=blogic@openwrt.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-mips@linux-mips.org \ --cc=matthias.bgg@gmail.com \ --cc=ralf@linux-mips.org \ --cc=yongjun_wei@trendmicro.com.cn \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.