summaryrefslogtreecommitdiffstats
path: root/drivers/clk/ti
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2015-07-15 20:55:42 +0200
committerStephen Boyd <sboyd@codeaurora.org>2015-07-28 20:58:35 +0200
commitf645f72d876586c4950dcd5bf516744db0aeb30b (patch)
tree0edcbf5f9e6bdd4ecba39d30f49a9f0536976c21 /drivers/clk/ti
parentMerge branch 'for-4.2/ti-clk-move' of https://github.com/t-kristo/linux-pm in... (diff)
downloadlinux-f645f72d876586c4950dcd5bf516744db0aeb30b.tar.xz
linux-f645f72d876586c4950dcd5bf516744db0aeb30b.zip
clk: ti: Check kzalloc() for failures
smatch reports a failure to check kzalloc() here: drivers/clk/ti/clk.c:232 omap2_clk_provider_init() error: potential null dereference 'io'. (kzalloc returns null) Check for an allocation failure and return -ENOMEM. Acked-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/clk/ti')
-rw-r--r--drivers/clk/ti/clk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c
index 3343bde47fe4..521e330e3046 100644
--- a/drivers/clk/ti/clk.c
+++ b/drivers/clk/ti/clk.c
@@ -227,6 +227,8 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index,
clocks_node_ptr[index] = clocks;
io = kzalloc(sizeof(*io), GFP_KERNEL);
+ if (!io)
+ return -ENOMEM;
io->regmap = syscon;
io->mem = mem;