Re: [PATCH] xtensa: time: Fix clk reference leak in calibrate_ccount()

From: Max Filippov

Date: Thu Sep 10 2026 - 06:59:15 EST


On Wed, Sep 9, 2026 at 10:07 PM blaze <1466528493@xxxxxx> wrote:
>
> From: 赵宇 <1466528493@xxxxxx>
>
> In calibrate_ccount(), of_clk_get() acquires a reference to the CPU
> clock, but clk_put() is never called to release it. The clock
> reference is used only to read the frequency via clk_get_rate(),
> then the function returns immediately, leaking the reference.
>
> Fix this by calling clk_put(clk) before returning.
>
> Signed-off-by: 赵宇 <1466528493@xxxxxx>
> ---
> arch/xtensa/kernel/time.c | 1 +
> 1 file changed, 1 insertion(+)

Thank you for taking time to explain and resubmit.
Applied to my xtensa tree.

--
Thanks.
-- Max