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

clk: nxp: clk-lpc18xx-ccu: Unmap region obtained by of_iomap

Free memory mapping, if lpc18xx_ccu_init() is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Acked-by: Joachim Eastwood <manabian@gmail.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Arvind Yadav and committed by
Stephen Boyd
45261a3e f84d42a9

+4 -1
+4 -1
drivers/clk/nxp/clk-lpc18xx-ccu.c
··· 277 277 } 278 278 279 279 clk_data = kzalloc(sizeof(*clk_data), GFP_KERNEL); 280 - if (!clk_data) 280 + if (!clk_data) { 281 + iounmap(reg_base); 281 282 return; 283 + } 282 284 283 285 clk_data->num = of_property_count_strings(np, "clock-names"); 284 286 clk_data->name = kcalloc(clk_data->num, sizeof(char *), GFP_KERNEL); 285 287 if (!clk_data->name) { 288 + iounmap(reg_base); 286 289 kfree(clk_data); 287 290 return; 288 291 }