[3.16.y-ckt stable] Patch "clk: versatile-icst: fix memory leak" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Nov 30 12:35:07 UTC 2015


This is a note to let you know that I have just added a patch titled

    clk: versatile-icst: fix memory leak

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue

This patch is scheduled to be released in version 3.16.7-ckt21.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 09b87fbf48c05c90c5d13c1ac58b6b32be6c2d00 Mon Sep 17 00:00:00 2001
From: Linus Walleij <linus.walleij at linaro.org>
Date: Fri, 23 Oct 2015 11:36:01 +0200
Subject: clk: versatile-icst: fix memory leak

commit 7bdccef34fc67d3fce6778a018601dd41e43c5ce upstream.

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 at codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
Signed-off-by: Stephen Boyd <sboyd at codeaurora.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/clk/versatile/clk-icst.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/versatile/clk-icst.c b/drivers/clk/versatile/clk-icst.c
index bc96f103bd7c..9064636a867f 100644
--- a/drivers/clk/versatile/clk-icst.c
+++ b/drivers/clk/versatile/clk-icst.c
@@ -156,8 +156,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;
 }




More information about the kernel-team mailing list