[3.13.y.z extended stable] Patch "clk: s2mps11: Fix possible NULL pointer dereference" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Thu May 1 19:17:25 UTC 2014

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

    clk: s2mps11: Fix possible NULL pointer dereference

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


This patch is scheduled to be released in version

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.13.y.z tree, see



>From 366200c3429310ebefef1eb4459b91267db9b678 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <k.kozlowski at samsung.com>
Date: Fri, 21 Mar 2014 13:18:17 +0100
Subject: clk: s2mps11: Fix possible NULL pointer dereference

commit 238e14055da87d0d012257788e39fe0df3a82226 upstream.

If parent device does not have of_node set the s2mps11_clk_parse_dt()
returned NULL. This NULL was later passed to of_clk_add_provider() which
dereferenced it in pr_debug() call.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski at samsung.com>
Signed-off-by: Mike Turquette <mturquette at linaro.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/clk/clk-s2mps11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c
index 00a3abe..27c83e4 100644
--- a/drivers/clk/clk-s2mps11.c
+++ b/drivers/clk/clk-s2mps11.c
@@ -130,7 +130,7 @@ static struct device_node *s2mps11_clk_parse_dt(struct platform_device *pdev)
 	int i;

 	if (!iodev->dev->of_node)
-		return NULL;
+		return ERR_PTR(-EINVAL);

 	clk_np = of_find_node_by_name(iodev->dev->of_node, "clocks");
 	if (!clk_np) {

More information about the kernel-team mailing list