Commit 7bdccef3 authored by Linus Walleij's avatar Linus Walleij Committed by Stephen Boyd

clk: versatile-icst: fix memory leak

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>
parent acba7855
......@@ -157,8 +157,10 @@ struct clk *icst_clk_register(struct device *dev,
icst->lockreg = base + desc->lock_offset;
clk = clk_register(dev, &icst->hw);
if (IS_ERR(clk))
if (IS_ERR(clk)) {
kfree(pclone);
kfree(icst);
}
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