Re: [PATCH v2] clk: Fix memory leak in devm_clk_notifier_register()

From: Stephen Boyd
Date: Tue Jun 20 2023 - 15:03:21 EST


Quoting Fei Shao (2023-06-18 20:22:53)
> devm_clk_notifier_register() allocates a devres resource for clk
> notifier but didn't register that to the device, so the notifier didn't
> get unregistered on device detach and the allocated resource was leaked.
>
> Fix the issue by registering the resource through devres_add().
>
> Fixes: 6d30d50d037d ("clk: add devm variant of clk_notifier_register")
> Signed-off-by: Fei Shao <fshao@xxxxxxxxxxxx>
> ---

Applied to clk-next

It would be nice to also add a test or two for this.