Re: [PATCH] clk: test: Fix some memory leaks

From: Stephen Boyd
Date: Wed Oct 16 2024 - 17:41:02 EST


Quoting Jinjie Ruan (2024-10-15 19:26:58)
> CONFIG_CLK_KUNIT_TEST=y, CONFIG_DEBUG_KMEMLEAK=y
> and CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the following memory leak occurs.
>
> If the KUNIT_ASSERT_*() fails, the latter (exit() or testcases)
> clk_put() or clk_hw_unregister() will fail to release the clk resource
> and cause memory leaks, use new clk_hw_register_kunit()
> and clk_hw_get_clk_kunit() to automatically release them.
[...]
>
> Fixes: 02cdeace1e1e ("clk: tests: Add tests for single parent mux")
> Fixes: 2e9cad1abc71 ("clk: tests: Add some tests for orphan with multiple parents")
> Fixes: 433fb8a611ca ("clk: tests: Add missing test case for ranges")
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> ---

Applied to clk-fixes