]> git.ipfire.org Git - people/arne_f/kernel.git/commit
clk: sunxi-ng: Check kzalloc() for errors and cleanup error path
authorStephen Boyd <sboyd@codeaurora.org>
Sat, 7 Oct 2017 22:36:52 +0000 (22:36 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2017 09:08:35 +0000 (10:08 +0100)
commitceec8374d790f55315deda0cd076b2a556a808c0
treee3ab23d655553fb8be9a190a0000fd788ddfe7f4
parentd3b56161e0a35ac64203b01a77e3afbc6ae732f7
clk: sunxi-ng: Check kzalloc() for errors and cleanup error path

[ Upstream commit 5d806f9fc8e63d7a44e0fd1ef26a7c27efae0e51 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/sunxi-ng/ccu_common.c