Skip to content

Commit 2d4fcc5

Browse files
Dan Carpenterbebarino
authored andcommitted
clk: versatile: clk-icst: use after free on error path
This frees "name" and then tries to display in as part of the error message on the next line. Swap the order. Fixes: 1b2189f ("clk: versatile: clk-icst: Ensure clock names are unique") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20211117072604.GC5237@kili Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent e53f208 commit 2d4fcc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/clk/versatile/clk-icst.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ static void __init of_syscon_icst_setup(struct device_node *np)
543543

544544
regclk = icst_clk_setup(NULL, &icst_desc, name, parent_name, map, ctype);
545545
if (IS_ERR(regclk)) {
546-
kfree(name);
547546
pr_err("error setting up syscon ICST clock %s\n", name);
547+
kfree(name);
548548
return;
549549
}
550550
of_clk_add_provider(np, of_clk_src_simple_get, regclk);

0 commit comments

Comments
 (0)