2016-10-29 13:59:11

by Christophe JAILLET

[permalink] [raw]
Subject: [PATCH] ARM: spear: Fix error handling

'clk_get_sys()' returns an error pointer in case of error, not NULL. So
test it with IS_ERR.

Signed-off-by: Christophe JAILLET <[email protected]>
---
arch/arm/mach-spear/time.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
index 9ccffc1d0f28..4878ba90026d 100644
--- a/arch/arm/mach-spear/time.c
+++ b/arch/arm/mach-spear/time.c
@@ -233,7 +233,7 @@ void __init spear_setup_of_timer(void)
}

gpt_clk = clk_get_sys("gpt0", NULL);
- if (!gpt_clk) {
+ if (IS_ERR(gpt_clk)) {
pr_err("%s:couldn't get clk for gpt\n", __func__);
goto err_iomap;
}
--
2.9.3


2016-10-31 16:18:37

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH] ARM: spear: Fix error handling

For the spear or arm-soc guys to deal with...

On Sat, Oct 29, 2016 at 03:58:39PM +0200, Christophe JAILLET wrote:
> 'clk_get_sys()' returns an error pointer in case of error, not NULL. So
> test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> arch/arm/mach-spear/time.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c
> index 9ccffc1d0f28..4878ba90026d 100644
> --- a/arch/arm/mach-spear/time.c
> +++ b/arch/arm/mach-spear/time.c
> @@ -233,7 +233,7 @@ void __init spear_setup_of_timer(void)
> }
>
> gpt_clk = clk_get_sys("gpt0", NULL);
> - if (!gpt_clk) {
> + if (IS_ERR(gpt_clk)) {
> pr_err("%s:couldn't get clk for gpt\n", __func__);
> goto err_iomap;
> }
> --
> 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.

2016-11-02 02:25:56

by Viresh Kumar

[permalink] [raw]
Subject: Re: [PATCH] ARM: spear: Fix error handling

On Sat, Oct 29, 2016 at 7:28 PM, Christophe JAILLET
<[email protected]> wrote:
> 'clk_get_sys()' returns an error pointer in case of error, not NULL. So
> test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <[email protected]>
> ---
> arch/arm/mach-spear/time.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Viresh Kumar <[email protected]>

2016-11-08 01:19:11

by Olof Johansson

[permalink] [raw]
Subject: Re: [PATCH] ARM: spear: Fix error handling

On Sat, Oct 29, 2016 at 03:58:39PM +0200, Christophe JAILLET wrote:
> 'clk_get_sys()' returns an error pointer in case of error, not NULL. So
> test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <[email protected]>

Applied to fixes-non-critical, thanks.


-Olof