From: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
To: shyckless@gmail.com, rafael@kernel.org, viresh.kumar@linaro.org,
krzk@kernel.org, peter.griffin@linaro.org
Cc: linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org,
alim.akhtar@samsung.com, linux-kernel@vger.kernel.org,
Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
Subject: Re: [PATCH 1/3] cpufreq: highbank: Put cpu clock if clk notifier registration fails
Date: Mon, 23 Nov 2026 11:21:17 +0800 [thread overview]
Message-ID: <681285cf-b668-46c6-b6b1-793782925602@oss.qualcomm.com> (raw)
In-Reply-To: <20261122-cpufreq-leaks-v1-1-96fc17ff7339@gmail.com>
On 11/22/2026 7:55 PM, Suyuan Wang via B4 Relay wrote:
> From: Suyuan Wang <stevewong@hust.edu.cn>
>
> hb_cpufreq_driver_init() gets the cpu0 clock with clk_get() and then
> registers a clk notifier on it. If clk_notifier_register() fails, the
> function jumps to out_put_node and returns the error, but the clock
> reference is never dropped.
>
> Call clk_put() on that error path.
>
> Found with a static analysis tool and checked by hand.
>
> Fixes: 6754f556103b ("cpufreq / highbank: add support for highbank cpufreq")
> Co-developed-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Kaixuan Li <kaixuan.li@ntu.edu.sg>
> Signed-off-by: Suyuan Wang <stevewong@hust.edu.cn>
Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>
> ---
> drivers/cpufreq/highbank-cpufreq.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c
> index a45864701143..ccdaff4384d2 100644
> --- a/drivers/cpufreq/highbank-cpufreq.c
> +++ b/drivers/cpufreq/highbank-cpufreq.c
> @@ -89,6 +89,7 @@ static int __init hb_cpufreq_driver_init(void)
> ret = clk_notifier_register(cpu_clk, &hb_cpufreq_clk_nb);
> if (ret) {
> pr_err("failed to register clk notifier: %d\n", ret);
> + clk_put(cpu_clk);
> goto out_put_node;
> }
>
>
--
Thx and BRs,
Zhongqiu Han
next prev parent reply other threads:[~2026-11-23 3:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 11:55 [PATCH 0/3] cpufreq: Fix leaks on probe error paths in three drivers Suyuan Wang via B4 Relay
2026-11-22 11:55 ` [PATCH 1/3] cpufreq: highbank: Put cpu clock if clk notifier registration fails Suyuan Wang via B4 Relay
2026-11-23 3:21 ` Zhongqiu Han [this message]
2026-11-22 11:55 ` [PATCH 2/3] cpufreq: kirkwood: Put clocks on error and in remove Suyuan Wang via B4 Relay
2026-11-23 3:42 ` Zhongqiu Han
2026-11-22 11:55 ` [PATCH 3/3] cpufreq: s5pv210: Fix resource leaks on probe error paths Suyuan Wang via B4 Relay
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=681285cf-b668-46c6-b6b1-793782925602@oss.qualcomm.com \
--to=zhongqiu.han@oss.qualcomm.com \
--cc=alim.akhtar@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=peter.griffin@linaro.org \
--cc=rafael@kernel.org \
--cc=shyckless@gmail.com \
--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®