Skip to content
Commit 188d070d authored by Hao Luo's avatar Hao Luo Committed by Abel Vesa
Browse files

clk: imx: clk-imx8mn: fix memory leak in imx8mn_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().

Fixes: daeb1454 ("clk: imx: imx8mn: Switch to clk_hw based API")
Fixes: 96d6392b ("clk: imx: Add support for i.MX8MN clock driver")
Signed-off-by: default avatarHao Luo <m202171776@hust.edu.cn>
Reviewed-by: default avatarDongliang Mu <dzm91@hust.edu.cn>
Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20230411015107.2645-1-m202171776@hust.edu.cn


Signed-off-by: default avatarAbel Vesa <abel.vesa@linaro.org>
parent 6e6bb163
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment