aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/rockchip/clk-rockchip.c
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2016-08-13 11:26:18 -0400
committerHeiko Stuebner <heiko@sntech.de>2016-08-23 12:00:25 -0400
commit023a8280b8355a0aebe094299afec8d8b7b264cd (patch)
treed3b1952c3cd7088233a1ce06f5c81821245c17a4 /drivers/clk/rockchip/clk-rockchip.c
parent54479449c801e46ee2b6ba08e2f19cd810f74f94 (diff)
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>
Diffstat (limited to 'drivers/clk/rockchip/clk-rockchip.c')
-rw-r--r--drivers/clk/rockchip/clk-rockchip.c7
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)
49 } 49 }
50 50
51 reg = of_iomap(node, 0); 51 reg = of_iomap(node, 0);
52 if (!reg)
53 return;
52 54
53 clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); 55 clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL);
54 if (!clk_data) 56 if (!clk_data) {
57 iounmap(reg);
55 return; 58 return;
59 }
56 60
57 clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL); 61 clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL);
58 if (!clk_data->clks) { 62 if (!clk_data->clks) {
59 kfree(clk_data); 63 kfree(clk_data);
64 iounmap(reg);
60 return; 65 return;
61 } 66 }
62 67