Skip to content

Commit 9c632a6

Browse files
Dan Carpenterbebarino
authored andcommitted
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: 5a85372 ("staging: clocking-wizard: Add support for dynamic reconfiguration") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Michal Simek <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent da2edb3 commit 9c632a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/xilinx/clk-xlnx-clock-wizard.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static struct clk *clk_wzrd_register_divider(struct device *dev,
525525
hw = &div->hw;
526526
ret = devm_clk_hw_register(dev, hw);
527527
if (ret)
528-
hw = ERR_PTR(ret);
528+
return ERR_PTR(ret);
529529

530530
return hw->clk;
531531
}

0 commit comments

Comments
 (0)