projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d34105
)
clk: ti: Check kzalloc() for failures
author
Stephen Boyd
<sboyd@codeaurora.org>
Wed, 15 Jul 2015 18:55:42 +0000
(11:55 -0700)
committer
Stephen Boyd
<sboyd@codeaurora.org>
Tue, 28 Jul 2015 18:58:35 +0000
(11:58 -0700)
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>
drivers/clk/ti/clk.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/clk/ti/clk.c
b/drivers/clk/ti/clk.c
index 3343bde47fe44a697edc9885b5a95fb2c44f80f4..521e330e304689050c3874f1dbc05a3c0c985469 100644
(file)
--- 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;