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)
committerStephen Boyd <sboyd@kernel.org>
Thu, 15 Jun 2023 00:22:50 +0000 (17:22 -0700)
commit9c632a6396505a019ea6d12b5ab45e659a542a93
treeccfbc3f16aa11a85315a4d9b32f57a30565d1dcb
parentda2edb3e3c09fd1451b7f400ccd1070ef086619a
clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()

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>
drivers/clk/xilinx/clk-xlnx-clock-wizard.c