From: Linus Walleij Date: Fri, 23 Oct 2015 09:36:01 +0000 (+0200) Subject: clk: versatile-icst: fix memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7bdccef34fc67d3fce6778a018601dd41e43c5ce;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Linus Walleij Signed-off-by: Stephen Boyd --- 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; }