Re: [PATCH] clk: sunxi-ng: Check kzalloc() for errors and cleanup error path

From: Maxime Ripard
Date: Mon Feb 06 2017 - 05:51:25 EST


On Fri, Feb 03, 2017 at 03:00:50PM -0800, Stephen Boyd wrote:
> This kzalloc() could fail. Let's bail out with -ENOMEM here
> instead of NULL dereferencing. That silences static checkers. We
> should also cleanup on the error path even though this function
> returning an error probably means the system won't boot.
>
> Cc: Chen-Yu Tsai <wens@xxxxxxxx>
> Cc: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>

Acked-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>

Can you apply it directly?

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Attachment: signature.asc
Description: PGP signature