mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
clk: hisilicon: hi3559a: Fix an erroneous devm_kfree()
[ Upstream commit64c6a38136
] 'p_clk' is an array allocated just before the for loop for all clk that need to be registered. It is incremented at each loop iteration. If a clk_register() call fails, 'p_clk' may point to something different from what should be freed. The best we can do, is to avoid this wrong release of memory. Fixes:6c81966107
("clk: hisilicon: Add clock driver for hi3559A SoC") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/773fc8425c3b8f5b0ca7c1d89f15b65831a85ca9.1705850155.git.christophe.jaillet@wanadoo.fr Signed-off-by: Stephen Boyd <sboyd@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b3e3fb2752
commit
d575765b1b
1 changed files with 0 additions and 1 deletions
|
@ -491,7 +491,6 @@ static void hisi_clk_register_pll(struct hi3559av100_pll_clock *clks,
|
|||
|
||||
clk = clk_register(NULL, &p_clk->hw);
|
||||
if (IS_ERR(clk)) {
|
||||
devm_kfree(dev, p_clk);
|
||||
dev_err(dev, "%s: failed to register clock %s\n",
|
||||
__func__, clks[i].name);
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue