diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2014-03-21 13:18:17 +0100 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-03-24 15:11:27 -0700 |
commit | 238e14055da87d0d012257788e39fe0df3a82226 (patch) | |
tree | aea727b6ee2e027605899a8ab662bc2856bdbe62 | |
parent | c115b13b85af69df0314556213db0b73cd8ea7e6 (diff) | |
download | linux-238e14055da87d0d012257788e39fe0df3a82226.tar.gz linux-238e14055da87d0d012257788e39fe0df3a82226.tar.bz2 linux-238e14055da87d0d012257788e39fe0df3a82226.zip |
clk: s2mps11: Fix possible NULL pointer dereference
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>
Cc: <stable@vger.kernel.org>
Signed-off-by: Mike Turquette <mturquette@linaro.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 f4c1f0881b6c..10e66e90d81c 100644 --- a/drivers/clk/clk-s2mps11.c +++ b/drivers/clk/clk-s2mps11.c @@ -132,7 +132,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) { |