diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2015-10-23 11:36:01 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2015-10-23 13:34:53 -0700 |
commit | 7bdccef34fc67d3fce6778a018601dd41e43c5ce (patch) | |
tree | 759ed05fef6cf3fa8ab6a159c51887c11be2cf6c /drivers/clk/versatile | |
parent | acba7855dda0d6e7d87dec2f89b4d9eebb36bbe2 (diff) |
clk: versatile-icst: fix memory leak
A static code checker found a memory leak in the Versatile
ICST code. Fix it.
Fixes: a183da637c52 "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>
Diffstat (limited to 'drivers/clk/versatile')
-rw-r--r-- | drivers/clk/versatile/clk-icst.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c index a3893ea2199d..08c5ee976879 100644 --- a/drivers/clk/versatile/clk-icst.c +++ b/drivers/clk/versatile/clk-icst.c @@ -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; } |