Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1512020 > unrolled thread

[PATCH] ARM: zx: Fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-10-30 09:20 +0100
Last post2016-11-08 02:20 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ARM: zx: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-10-30 09:20 +0100
    Re: [PATCH] ARM: zx: Fix error handling Russell King - ARM Linux <linux@armlinux.org.uk> - 2016-10-31 17:30 +0100
    Re: [PATCH] ARM: zx: Fix error handling Olof Johansson <olof@lixom.net> - 2016-11-08 02:20 +0100

#1512020 — [PATCH] ARM: zx: Fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-10-30 09:20 +0100
Subject[PATCH] ARM: zx: Fix error handling
Message-ID<sxTvr-29w-3@gated-at.bofh.it>
'devm_ioremap_resource()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
order to propagate the error value.
---
 arch/arm/mach-zx/zx296702-pm-domain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
index e08574d4e2ca..79dcf2549267 100644
--- a/arch/arm/mach-zx/zx296702-pm-domain.c
+++ b/arch/arm/mach-zx/zx296702-pm-domain.c
@@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev)
 	}
 
 	pcubase = devm_ioremap_resource(&pdev->dev, res);
-	if (!pcubase) {
+	if (IS_ERR(pcubase)) {
 		dev_err(&pdev->dev, "ioremap fail.\n");
 		return -EIO;
 	}
-- 
2.9.3

[toc] | [next] | [standalone]


#1512685

FromRussell King - ARM Linux <linux@armlinux.org.uk>
Date2016-10-31 17:30 +0100
Message-ID<synDc-4Pf-29@gated-at.bofh.it>
In reply to#1512020
Same as the other fix...

On Sun, Oct 30, 2016 at 09:10:10AM +0100, Christophe JAILLET wrote:
> 'devm_ioremap_resource()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
> order to propagate the error value.
> ---
>  arch/arm/mach-zx/zx296702-pm-domain.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-zx/zx296702-pm-domain.c b/arch/arm/mach-zx/zx296702-pm-domain.c
> index e08574d4e2ca..79dcf2549267 100644
> --- a/arch/arm/mach-zx/zx296702-pm-domain.c
> +++ b/arch/arm/mach-zx/zx296702-pm-domain.c
> @@ -169,7 +169,7 @@ static int zx296702_pd_probe(struct platform_device *pdev)
>  	}
>  
>  	pcubase = devm_ioremap_resource(&pdev->dev, res);
> -	if (!pcubase) {
> +	if (IS_ERR(pcubase)) {
>  		dev_err(&pdev->dev, "ioremap fail.\n");
>  		return -EIO;
>  	}
> -- 
> 2.9.3
> 

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

[toc] | [prev] | [next] | [standalone]


#1516712

FromOlof Johansson <olof@lixom.net>
Date2016-11-08 02:20 +0100
Message-ID<sB3eW-2Bm-9@gated-at.bofh.it>
In reply to#1512020
On Sun, Oct 30, 2016 at 09:10:10AM +0100, Christophe JAILLET wrote:
> 'devm_ioremap_resource()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> 'return -EIO;' could also be turned into 'return PTR_ERR(pcubase);' in
> order to propagate the error value.

Applied to fixes-non-critical. Thanks!


-Olof

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web