Skip to content

Commit

Permalink
clk: core: Copy connection id
Browse files Browse the repository at this point in the history
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 <leonard.crestez@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
  • Loading branch information
Leonard Crestez authored and Stephen Boyd committed Mar 7, 2017
1 parent cda82ac commit 253160a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id,

clk->core = hw->core;
clk->dev_id = dev_id;
clk->con_id = con_id;
clk->con_id = kstrdup_const(con_id, GFP_KERNEL);
clk->max_rate = ULONG_MAX;

clk_prepare_lock();
Expand All @@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk)
hlist_del(&clk->clks_node);
clk_prepare_unlock();

kfree_const(clk->con_id);
kfree(clk);
}

Expand Down

0 comments on commit 253160a

Please sign in to comment.