Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arvind Yadav and committed by
Heiko Stuebner
023a8280 54479449

+6 -1
+6 -1
drivers/clk/rockchip/clk-rockchip.c
··· 49 49 } 50 50 51 51 reg = of_iomap(node, 0); 52 + if (!reg) 53 + return; 52 54 53 55 clk_data = kzalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); 54 - if (!clk_data) 56 + if (!clk_data) { 57 + iounmap(reg); 55 58 return; 59 + } 56 60 57 61 clk_data->clks = kzalloc(qty * sizeof(struct clk *), GFP_KERNEL); 58 62 if (!clk_data->clks) { 59 63 kfree(clk_data); 64 + iounmap(reg); 60 65 return; 61 66 } 62 67