diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2014-03-21 13:18:17 +0100 |
---|---|---|
committer | Show Liu <show.liu@linaro.org> | 2014-06-18 11:42:48 +0800 |
commit | e83fd9314d43ce39d960a073f10cf230c892598e (patch) | |
tree | 963aef5c456472f3e7b03c44023e4c86cf9f97c1 /drivers/clk | |
parent | 78a6d5f637f98a8c501a211489f665d71fc58e0c (diff) |
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@samsung.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk-s2mps11.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c index 00a3abe103a..27c83e45eae 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) { |