* [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()
@ 2016-02-06 14:24 weiyj_lk at 163.com
2016-02-06 15:40 ` John Crispin
0 siblings, 1 reply; 3+ messages in thread
From: weiyj_lk at 163.com @ 2016-02-06 14:24 UTC (permalink / raw)
To: linux-arm-kernel
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()
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-10 9:01 ` Ralf Baechle
0 siblings, 1 reply; 3+ messages in thread
From: John Crispin @ 2016-02-06 15:40 UTC (permalink / raw)
To: linux-arm-kernel
On 06/02/2016 15:24, weiyj_lk at 163.com wrote:
> 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>
Hi,
thanks for the fix.
Acked-by: John Crispin <blogic@openwrt.org>
@Ralf: can you merge this via LMO with the next PR please ?
@mbgg: ignore the patch please it is for the legacy MIPS SoCs
John
> ---
> 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;
>
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] MIPS: pci-mt7620: Fix return value check in mt7620_pci_probe()
2016-02-06 15:40 ` John Crispin
@ 2016-02-10 9:01 ` Ralf Baechle
0 siblings, 0 replies; 3+ messages in thread
From: Ralf Baechle @ 2016-02-10 9:01 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Feb 06, 2016 at 04:40:03PM +0100, John Crispin wrote:
> On 06/02/2016 15:24, weiyj_lk at 163.com wrote:
> > 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>
>
> Hi,
>
> thanks for the fix.
>
> Acked-by: John Crispin <blogic@openwrt.org>
>
> @Ralf: can you merge this via LMO with the next PR please ?
>
> @mbgg: ignore the patch please it is for the legacy MIPS SoCs
Applied. Thanks folks,
Ralf
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-10 9:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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-10 9:01 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).