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: Gen Zhang <blackgod016574@gmail.com> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
This commit is contained in:
parent
a188339ca5
commit
fcdf445ff4
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue