Skip to content

Commit 253160a

Browse files
cdleonardbebarino
authored andcommitted
clk: core: Copy connection id
Some drivers use sprintf to build clk connection id names but the clk core will save those strings and occasionally print them back. Duplicate the con_id strings instead of fixing all the users. Signed-off-by: Leonard Crestez <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent cda82ac commit 253160a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/clk/clk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,
25022502

25032503
clk->core = hw->core;
25042504
clk->dev_id = dev_id;
2505-
clk->con_id = con_id;
2505+
clk->con_id = kstrdup_const(con_id, GFP_KERNEL);
25062506
clk->max_rate = ULONG_MAX;
25072507

25082508
clk_prepare_lock();
@@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk)
25182518
hlist_del(&clk->clks_node);
25192519
clk_prepare_unlock();
25202520

2521+
kfree_const(clk->con_id);
25212522
kfree(clk);
25222523
}
25232524

0 commit comments

Comments
 (0)