Home
last modified time | relevance | path

Searched hist:"1 b280598ab3bd8a2dc8b96a12530d5b1ee7a8f4a" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/clk/imx/
H A Dclk-imxrt1050.cdiff 1b280598ab3bd8a2dc8b96a12530d5b1ee7a8f4a Tue Apr 18 06:34:51 CDT 2023 Kai Ma <kaima@hust.edu.cn> clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe

Use devm_of_iomap() instead of of_iomap() to automatically
handle the unused ioremap region. If any error occurs, regions allocated by
kzalloc() will leak, but using devm_kzalloc() instead will automatically
free the memory using devm_kfree().

Also, fix error handling of hws by adding unregister_hws label, which
unregisters remaining hws when iomap failed.

Fixes: 7154b046d8f3 ("clk: imx: Add initial support for i.MXRT1050 clock driver")
Signed-off-by: Kai Ma <kaima@hust.edu.cn>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20230418113451.151312-1-kaima@hust.edu.cn
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>