diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2014-03-21 13:18:17 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-05-06 07:59:36 -0700 |
commit | 66e23040261cce32af8011582b4af652bb022bf0 (patch) | |
tree | c4042011dfe29d8c0477613b4561fa2364e43d95 | |
parent | e6713b5e477f4b3efda4faf1f4793acbdf722b06 (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>
-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) { |