clk: samsung: exynos5: Fix possible NULL pointer exception on platform_device_alloc...
authorKrzysztof Kozlowski <krzk@kernel.org>
Thu, 21 Feb 2019 11:45:51 +0000 (12:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:03 +0000 (20:10 +0100)
commit4d1de1e6d266f273f77f7323c7ef5ee87650bd4a
treed2a7d33d8582bc7d630947fe29c7c360abef51de
parent9aba7a8fd163b8a58a25505692542c184ab44b7f
clk: samsung: exynos5: Fix possible NULL pointer exception on platform_device_alloc() failure

commit 5f0b6216ea381b43c0dff88702d6cc5673d63922 upstream.

During initialization of subdevices if platform_device_alloc() failed,
returned NULL pointer will be later dereferenced.  Add proper error
paths to exynos5_clk_register_subcmu().  The return value of this
function is still ignored because at this stage of init there is nothing
we can do.

Fixes: b06a532bf1fa ("clk: samsung: Add Exynos5 sub-CMU clock driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/samsung/clk-exynos5-subcmu.c