mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
To: blaze <1466528493@qq.com>, rafael@kernel.org, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhongqiu.han@oss.qualcomm.com
Subject: Re: [PATCH] cpufreq: qoriq: Fix clk reference leak in get_bus_freq()
Date: Thu, 10 Sep 2026 00:22:11 +0800	[thread overview]
Message-ID: <d78f8ddc-3d51-415d-b399-5a39a63a2586@oss.qualcomm.com> (raw)
In-Reply-To: <tencent_60DAC4127B362B6743CB0BFA2C31982FD807@qq.com>

Hello,

On 9/9/2026 12:41 PM, blaze wrote:
> clk_get() acquires a reference to the clock which must be released with
> clk_put() when no longer needed. In get_bus_freq(), the clock reference
> obtained by clk_get() is used only to read the frequency via
> clk_get_rate(), but clk_put() is never called, causing a clock reference
> count leak on every invocation.
> 
> Fix this by calling clk_put() before returning the frequency.
> 
> Fixes: 1b6f255990ae ("cpufreq: qoriq: Enhance the support of clock from DTS")

I couldn't find this commit using either the commit ID or the subject.


git show 1b6f255990ae

fatal: ambiguous argument '1b6f255990ae': unknown revision or path not
...

> Signed-off-by: blaze <1466528493@qq.com>
> ---
>   drivers/cpufreq/qoriq-cpufreq.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
> index 0000000..1111111 100644

May I know why the blob hash is 0000000..1111111? Is this patch just
generated by AI tools?

> --- a/drivers/cpufreq/qoriq-cpufreq.c
> +++ b/drivers/cpufreq/qoriq-cpufreq.c
> @@ -62,7 +62,9 @@ static u32 get_bus_freq(void)
>   			       __func__, PTR_ERR(pltclk));
>   		return PTR_ERR(pltclk);
>   	}
> 
> -	return clk_get_rate(pltclk);
> +	sysfreq = clk_get_rate(pltclk);
> +	clk_put(pltclk);
> +	return sysfreq;
>   }
> 
>   static struct qoriq_cpu_data *qoriq_cpu_data;
> --
> 2.43.0
> 
> 


-- 
Thx and BRs,
Zhongqiu Han

      reply	other threads:[~2026-09-09 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  4:41 blaze
2026-09-09 16:22 ` Zhongqiu Han [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d78f8ddc-3d51-415d-b399-5a39a63a2586@oss.qualcomm.com \
    --to=zhongqiu.han@oss.qualcomm.com \
    --cc=1466528493@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®