Skip to content

Commit 91bbc17

Browse files
tititiou36bebarino
authored andcommitted
clk: at91: Fix a return value in case of error
If 'clk_hw_register()' fails, it is likely that we expect to return an error instead of a valid pointer (which would mean success). Fix commit f5644f1 ("clk: at91: Migrate to clk_hw based registration and OF APIs") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 5c6201e commit 91bbc17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/at91/clk-programmable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ at91_clk_register_programmable(struct regmap *regmap,
203203
ret = clk_hw_register(NULL, &prog->hw);
204204
if (ret) {
205205
kfree(prog);
206-
hw = &prog->hw;
206+
hw = ERR_PTR(ret);
207207
}
208208

209209
return hw;

0 commit comments

Comments
 (0)