diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2016-08-13 20:56:18 +0530 |
---|---|---|
committer | Heiko Stuebner <heiko@sntech.de> | 2016-08-23 18:00:25 +0200 |
commit | 023a8280b8355a0aebe094299afec8d8b7b264cd (patch) | |
tree | d3b1952c3cd7088233a1ce06f5c81821245c17a4 | |
parent | 54479449c801e46ee2b6ba08e2f19cd810f74f94 (diff) | |
download | linux-023a8280b8355a0aebe094299afec8d8b7b264cd.tar.bz2 |
clk: rockchip: handle of_iomap failures in legacy clock driver
Check return value of of_iomap and handle errors correctly.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r-- | drivers/clk/rockchip/clk-rockchip.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/clk/rockchip/clk-rockchip.c b/drivers/clk/rockchip/clk-rockchip.c index 4cf838d52ef6..2c9bb81144c9 100644 --- a/drivers/clk/rockchip/clk-rockchip.c +++ b/drivers/clk/rockchip/clk-rockchip.c @@ -49,14 +49,19 @@ static void __init rk2928_gate_clk_init(struct device_node *node) } reg = of_iomap(node, 0); + if (!reg) + return; clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); - if (!clk_data) + if (!clk_data) { + iounmap(reg); return; + } clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL); if (!clk_data->clks) { kfree(clk_data); + iounmap(reg); return; } |