Commit 023a8280 authored by Arvind Yadav's avatar Arvind Yadav Committed by Heiko Stuebner

clk: rockchip: handle of_iomap failures in legacy clock driver

Check return value of of_iomap and handle errors correctly.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
parent 54479449
...@@ -49,14 +49,19 @@ static void __init rk2928_gate_clk_init(struct device_node *node) ...@@ -49,14 +49,19 @@ static void __init rk2928_gate_clk_init(struct device_node *node)
} }
reg = of_iomap(node, 0); reg = of_iomap(node, 0);
if (!reg)
return;
clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
if (!clk_data) if (!clk_data) {
iounmap(reg);
return; return;
}
clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL); clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL);
if (!clk_data->clks) { if (!clk_data->clks) {
kfree(clk_data); kfree(clk_data);
iounmap(reg);
return; return;
} }
......
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