]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
clk: sunxi-ng: Check kzalloc() for errors and cleanup error path
authorStephen Boyd <sboyd@codeaurora.org>
Fri, 3 Feb 2017 20:43:11 +0000 (12:43 -0800)
committerStephen Boyd <sboyd@codeaurora.org>
Mon, 6 Feb 2017 22:48:32 +0000 (14:48 -0800)
commit5d806f9fc8e63d7a44e0fd1ef26a7c27efae0e51
tree9b4313c80e5a6f8f2ba0822ba2d46c0c162706aa
parentca6f2796eef7fcff66a3b3f4bf45a7493ead0620
clk: sunxi-ng: Check kzalloc() for errors and cleanup error path

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@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/sunxi-ng/ccu_common.c