lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 16 Jan 2014 10:37:18 +0100
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Wei Yongjun <weiyj.lk@...il.com>, tglx@...utronix.de
CC:	yongjun_wei@...ndmicro.com.cn, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] clocksource: keystone: Fix return value check in
 keystone_timer_init()

On 01/16/2014 09:29 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
>
> In case of error, function of_clk_get() 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@...ndmicro.com.cn>
> ---
>   drivers/clocksource/timer-keystone.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/timer-keystone.c b/drivers/clocksource/timer-keystone.c
> index cbac8d0..4ca05ec 100644
> --- a/drivers/clocksource/timer-keystone.c
> +++ b/drivers/clocksource/timer-keystone.c
> @@ -168,7 +168,7 @@ static void __init keystone_timer_init(struct device_node *np)
>   	}
>
>   	clk = of_clk_get(np, 0);
> -	if (!clk) {
> +	if (IS_ERR(clk)) {
>   		pr_err("%s: failed to get clock\n", __func__);
>   		iounmap(timer.base);
>   		return;

Good catch. Applied for 3.15.

Thanks for the fix.

   -- Daniel





-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ