Commit 1dd9fe07 authored by Linus Walleij's avatar Linus Walleij Committed by Kamal Mostafa

clk: versatile-icst: fix memory leak

commit 7bdccef3 upstream.

A static code checker found a memory leak in the Versatile
ICST code. Fix it.

Fixes: a183da63 "clk: versatile: respect parent rate in ICST clock"
Reported-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent fc067818
...@@ -156,8 +156,10 @@ struct clk *icst_clk_register(struct device *dev, ...@@ -156,8 +156,10 @@ struct clk *icst_clk_register(struct device *dev,
icst->lockreg = base + desc->lock_offset; icst->lockreg = base + desc->lock_offset;
clk = clk_register(dev, &icst->hw); clk = clk_register(dev, &icst->hw);
if (IS_ERR(clk)) if (IS_ERR(clk)) {
kfree(pclone);
kfree(icst); kfree(icst);
}
return clk; return clk;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment