From: Anas Iqbal <mohd.abd.6602@gmail.com>
To: Chanwoo Choi <cw00.choi@samsung.com>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Heiko Stuebner <heiko@sntech.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Sebastian Reichel <sebastian.reichel@collabora.com>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Anas Iqbal <mohd.abd.6602@gmail.com>
Subject: [PATCH] devfreq: event: rockchip-dfi: fix missing clk_disable_unprepare() on error
Date: Thu, 19 Mar 2026 16:30:11 +0000 [thread overview]
Message-ID: <20260319163011.18876-1-mohd.abd.6602@gmail.com> (raw)
Smatch reports:
drivers/devfreq/event/rockchip-dfi.c:215 rockchip_dfi_enable() warn:
'dfi->clk' from clk_prepare_enable() not released.
If rockchip_dfi_ddrtype_to_ctrl() fails after clk_prepare_enable(),
the clock is not disabled, leading to a resource leak.
Add clk_disable_unprepare() in the error path to properly release
the clock.
Fixes: d724f4a4581b ("PM / devfreq: rockchip-dfi: Prepare for multiple users")
Signed-off-by: Anas Iqbal <mohd.abd.6602@gmail.com>
---
drivers/devfreq/event/rockchip-dfi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/devfreq/event/rockchip-dfi.c b/drivers/devfreq/event/rockchip-dfi.c
index 5e6e7e900bda..8db0bceeded4 100644
--- a/drivers/devfreq/event/rockchip-dfi.c
+++ b/drivers/devfreq/event/rockchip-dfi.c
@@ -185,8 +185,10 @@ static int rockchip_dfi_enable(struct rockchip_dfi *dfi)
}
ret = rockchip_dfi_ddrtype_to_ctrl(dfi, &ctrl);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(dfi->clk);
goto out;
+ }
for (i = 0; i < dfi->max_channels; i++) {
--
2.43.0
next reply other threads:[~2026-03-19 16:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 16:30 Anas Iqbal [this message]
2026-04-29 22:35 ` [PATCH] devfreq: event: rockchip-dfi: fix missing clk_disable_unprepare() on error Choi Chanwoo
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=20260319163011.18876-1-mohd.abd.6602@gmail.com \
--to=mohd.abd.6602@gmail.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=cw00.choi@samsung.com \
--cc=heiko@sntech.de \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=myungjoo.ham@samsung.com \
--cc=s.hauer@pengutronix.de \
--cc=sebastian.reichel@collabora.com \
/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