Re: [PATCH v3 3/8] clk: sunxi-ng: fix ccu probe clock unregister on error

From: Chen-Yu Tsai

Date: Thu Jul 02 2026 - 09:30:22 EST


On Thu, Jul 2, 2026 at 4:10 PM Jerome Brunet <jbrunet@xxxxxxxxxxxx> wrote:
>
> When registering clocks with sunxi_ccu_probe(), the number of ccu_clocks
> and the number of hw clocks might be different, eventhough they usually are
> the same.
>
> If they are different, it could lead to out-of-bound access or registered
> clock left behind on error.
>
> Use a different variable when iterating on hw clocks so every registered
> clock, and only those, gets unregistered on error.
>
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/r/20260629131254.7E34C1F00A3A@xxxxxxxxxxxxxxx
> Signed-off-by: Jerome Brunet <jbrunet@xxxxxxxxxxxx>

Reviewed-by: Chen-Yu Tsai <wens@xxxxxxxxxx>