]> git.hungrycats.org Git - linux/commit
clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 11 May 2023 17:01:20 +0000 (20:01 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jul 2023 17:39:42 +0000 (19:39 +0200)
commit25dbdfb7b71ef8601d00c6d9a2b1a96de28b30c5
tree7da6c2da2ead919ae41b4818b92b1723c28f2919
parentd0f4af90ad8f974ee2ab0be4984a7cc14bb1cd89
clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()

[ Upstream commit 9c632a6396505a019ea6d12b5ab45e659a542a93 ]

Smatch detected this potential error pointer dereference
clk_wzrd_register_divider().  If devm_clk_hw_register() fails then
it sets "hw" to an error pointer and then dereferences it on the
next line.  Return the error directly instead.

Fixes: 5a853722eb32 ("staging: clocking-wizard: Add support for dynamic reconfiguration")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/f0e39b5c-4554-41e0-80d9-54ca3fabd060@kili.mountain
Reviewed-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/xilinx/clk-xlnx-clock-wizard.c