diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2014-03-21 13:18:17 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-05-15 09:55:41 +0200 |
commit | eb41a94f97f00a895dbc1130d064954b54718373 (patch) | |
tree | 901aa183340609dc7bdb6f56e50517077091bd27 /drivers/clk | |
parent | 6c2d09eef51c2a403ff782c0171f6d127ffd5fc8 (diff) | |
download | lwn-eb41a94f97f00a895dbc1130d064954b54718373.tar.gz lwn-eb41a94f97f00a895dbc1130d064954b54718373.zip |
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: Jiri Slaby <jslaby@suse.cz>
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 7be41e676a64..aa21299ec7d2 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) { |