Skip to content

Commit 8b3d743

Browse files
Uwe Kleine-Königbebarino
authored andcommitted
clk: Fix pointer casting to prevent oops in devm_clk_release()
The release function is called with a pointer to the memory returned by devres_alloc(). I was confused about that by the code before the generalization that used a struct clk **ptr. Reported-by: Marek Szyprowski <[email protected]> Fixes: abae8e5 ("clk: generalize devm_clk_get() a bit") Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Marek Szyprowski <[email protected]> Tested-by: Linux Kernel Functional Testing <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 68bde8b commit 8b3d743

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/clk-devres.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct devm_clk_state {
1111

1212
static void devm_clk_release(struct device *dev, void *res)
1313
{
14-
struct devm_clk_state *state = *(struct devm_clk_state **)res;
14+
struct devm_clk_state *state = res;
1515

1616
if (state->exit)
1717
state->exit(state->clk);

0 commit comments

Comments
 (0)