Skip to contentSkip to conversation

clk: versatile: free icst on error return

PATCH Applied Colin King 3 participants 3 messages Apr 12, 2014 – May 31, 2014

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 clk: versatile: free icst on error return

From: Colin Ian King <[email protected]>

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

---
 drivers/clk/versatile/clk-icst.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/versatile/clk-icst.c +1 -0
index a820b0c..eb3a1e4 100644
@@ -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);
 	}
Signature · 1 line
1.9.1
#2 lore raw
In reply to Colin King

Quoting Colin King (2014-04-12 10:59:14)

Quoted 6 lines

From: Colin Ian King <[email protected]>

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

Applied to clk-next.

Thanks,
Mike

Quoted 19 lines
---
 drivers/clk/versatile/clk-icst.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/versatile/clk-icst.c +1 -0
index a820b0c..eb3a1e4 100644
@@ -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);
        }
Signature · 1 line
1.9.1