Re: [PATCH] clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()

From: Stephen Boyd
Date: Sat Dec 16 2023 - 20:13:37 EST


Quoting Kuan-Wei Chiu (2023-12-10 08:50:40)
> In cases where kcalloc() fails for the 'clk_data->clks' allocation, the
> code path does not handle the failure gracefully, potentially leading
> to a memory leak. This fix ensures proper cleanup by freeing the
> allocated memory for 'clk_data' before returning.
>
> Signed-off-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
> ---

Applied to clk-next