summaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk-qoriq.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-11-23 11:06:50 +0100
committerStephen Boyd <sboyd@codeaurora.org>2015-11-30 22:00:54 +0100
commit279104e3ade92b38198fdaead9e84bd80057693a (patch)
tree9abfbbc1e62f217ed17f0b8d9e441400c390f140 /drivers/clk/clk-qoriq.c
parentimx/clk-pllv2: fix wrong do_div() usage (diff)
downloadlinux-279104e3ade92b38198fdaead9e84bd80057693a.tar.xz
linux-279104e3ade92b38198fdaead9e84bd80057693a.zip
clk: qoriq: fix memory leak
If get_pll_div() fails we exited by returning NULL but we missed releasing hwc. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Fixes: 0dfc86b3173f ("clk: qoriq: Move chip-specific knowledge into driver") Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/clk-qoriq.c')
-rw-r--r--drivers/clk/clk-qoriq.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/clk-qoriq.c b/drivers/clk/clk-qoriq.c
index 1ab0fb81c6a0..7bc1c4527ae4 100644
--- a/drivers/clk/clk-qoriq.c
+++ b/drivers/clk/clk-qoriq.c
@@ -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;
div = get_pll_div(cg, hwc, clksel);
- if (!div)
+ if (!div) {
+ kfree(hwc);
return NULL;
+ }
pct80_rate = clk_get_rate(div->clk);
pct80_rate *= 8;