Commit 3ffe1db4 authored by Linus Walleij's avatar Linus Walleij Committed by Luis Henriques

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 avatarLuis Henriques <luis.henriques@canonical.com>
parent dec3ceaf
...@@ -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