[PATCH] clk: mediatek: fix of_iomap memory leak

Stephen Boyd sboyd at kernel.org
Mon Jun 12 18:28:18 PDT 2023


Quoting Bosi Zhang (2023-04-22 01:43:31)
> Smatch reports:
> drivers/clk/mediatek/clk-mtk.c:583 mtk_clk_simple_probe() warn:
>     'base' from of_iomap() not released on lines: 496.
> 
> This problem was also found in linux-next. In mtk_clk_simple_probe(),
> base is not released when handling errors
> if clk_data is not existed, which may cause a leak.
> So free_base should be added here to release base.
> 
> Fixes: c58cd0e40ffa ("clk: mediatek: Add mtk_clk_simple_probe() to simplify clock providers")
> Signed-off-by: Bosi Zhang <u201911157 at hust.edu.cn>
> Reviewed-by: Dongliang Mu <dzm91 at hust.edu.cn>
> ---

Applied to clk-next



More information about the linux-arm-kernel mailing list