提交 279104e3 编写于 作者: S Sudip Mukherjee 提交者: Stephen Boyd

clk: qoriq: fix memory leak

If get_pll_div() fails we exited by returning NULL but we missed
releasing hwc.
Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
Fixes: 0dfc86b3 ("clk: qoriq: Move chip-specific knowledge into driver")
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 0d2681e1
...@@ -778,8 +778,10 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx) ...@@ -778,8 +778,10 @@ static struct clk * __init create_one_cmux(struct clockgen *cg, int idx)
*/ */
clksel = (cg_in(cg, hwc->reg) & CLKSEL_MASK) >> CLKSEL_SHIFT; clksel = (cg_in(cg, hwc->reg) & CLKSEL_MASK) >> CLKSEL_SHIFT;
div = get_pll_div(cg, hwc, clksel); div = get_pll_div(cg, hwc, clksel);
if (!div) if (!div) {
kfree(hwc);
return NULL; return NULL;
}
pct80_rate = clk_get_rate(div->clk); pct80_rate = clk_get_rate(div->clk);
pct80_rate *= 8; pct80_rate *= 8;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册