lkml.org 
[lkml]   [2014]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] clk: versatile: free icst on error return
Date
From: Colin Ian King <colin.king@canonical.com>

commit a183da63 introduced a new error return path that does
not kfree icst if the kmemdup of desc->params fails.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/clk/versatile/clk-icst.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index a820b0c..eb3a1e4 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -140,6 +140,7 @@ struct clk *icst_clk_register(struct device *dev,

pclone = kmemdup(desc->params, sizeof(*pclone), GFP_KERNEL);
if (!pclone) {
+ kfree(icst);
pr_err("could not clone ICST params\n");
return ERR_PTR(-ENOMEM);
}
--
1.9.1


\
 
 \ /
  Last update: 2014-04-12 20:41    [W:0.067 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site