Skip to content

Commit 5e75ea9

Browse files
Chunyan Zhangbebarino
authored andcommitted
clk: sprd: add missing kfree
The number of config registers for different pll clocks probably are not same, so we have to use malloc, and should free the memory before return. Fixes: 3e37b00 ("clk: sprd: add adjustable pll support") Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com> Link: https://lkml.kernel.org/r/20190905103009.27166-1-zhang.lyra@gmail.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 5f9e832 commit 5e75ea9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎drivers/clk/sprd/pll.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,
136136
k2 + refin * nint * CLK_PLL_1M;
137137
}
138138

139+
kfree(cfg);
139140
return rate;
140141
}
141142

@@ -222,6 +223,7 @@ static int _sprd_pll_set_rate(const struct sprd_pll *pll,
222223
if (!ret)
223224
udelay(pll->udelay);
224225

226+
kfree(cfg);
225227
return ret;
226228
}
227229

0 commit comments

Comments
 (0)