Re: [PATCH] clk: hisilicon: hi3559a: Fix an erroneous devm_kfree()

From: Stephen Boyd
Date: Wed Feb 21 2024 - 23:27:20 EST


Quoting Christophe JAILLET (2024-01-21 07:16:24)
> 'p_clk' is an array allocated just before the for loop for all clk that
> need to be registered.
> It is incremented at each loop iteration.
>
> If a clk_register() call fails, 'p_clk' may point to something different
> from what should be freed.
>
> The best we can do, is to avoid this wrong release of memory.
>
> Fixes: 6c81966107dc ("clk: hisilicon: Add clock driver for hi3559A SoC")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
> ---

Applied to clk-next

About doing the right thing, it seems OK to remove the free for now
because the code continues on anyway.