OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a188339
)
clk-sunxi: fix a missing-check bug in sunxi_divs_clk_setup()
author
Gen Zhang
<blackgod016574@gmail.com>
Tue, 28 May 2019 02:18:51 +0000
(10:18 +0800)
committer
Maxime Ripard
<maxime.ripard@bootlin.com>
Wed, 29 May 2019 08:04:55 +0000
(10:04 +0200)
In sunxi_divs_clk_setup(), 'derived_name' is allocated by kstrndup().
It returns NULL when fails. 'derived_name' should be checked.
Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
drivers/clk/sunxi/clk-sunxi.c
patch
|
blob
|
history
diff --git
a/drivers/clk/sunxi/clk-sunxi.c
b/drivers/clk/sunxi/clk-sunxi.c
index
f5b1c00
..
830bfb7
100644
(file)
--- a/
drivers/clk/sunxi/clk-sunxi.c
+++ b/
drivers/clk/sunxi/clk-sunxi.c
@@
-989,6
+989,8
@@
static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node,
if (endp) {
derived_name = kstrndup(clk_name, endp - clk_name,
GFP_KERNEL);
+ if (!derived_name)
+ return NULL;
factors.name = derived_name;
} else {
factors.name = clk_name;