Commit fcdf445f authored by Gen Zhang's avatar Gen Zhang Committed by Maxime Ripard

clk-sunxi: fix a missing-check bug in sunxi_divs_clk_setup()

In sunxi_divs_clk_setup(), 'derived_name' is allocated by kstrndup().
It returns NULL when fails. 'derived_name' should be checked.
Signed-off-by: default avatarGen Zhang <blackgod016574@gmail.com>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
parent a188339c
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment