clk: versatile-icst: fix memory leak

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

Fixes: a183da637c "clk: versatile: respect parent rate in ICST clock"
Reported-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Linus Walleij 2015-10-23 11:36:01 +02:00 committed by Stephen Boyd
parent acba7855dd
commit 7bdccef34f

View File

@ -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;
}