linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
@ 2022-05-14  8:40 Yang Yingliang
  0 siblings, 0 replies; only message in thread
From: Yang Yingliang @ 2022-05-14  8:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: daniel.lezcano, tglx

If clk_get_rate() fails, clk_disable_unprepare() need be called
in error path.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/clocksource/timer-ti-dm-systimer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
index 2737407ff069..632523c1232f 100644
--- a/drivers/clocksource/timer-ti-dm-systimer.c
+++ b/drivers/clocksource/timer-ti-dm-systimer.c
@@ -345,8 +345,10 @@ static int __init dmtimer_systimer_init_clock(struct dmtimer_systimer *t,
 		return error;
 
 	r = clk_get_rate(clock);
-	if (!r)
+	if (!r) {
+		clk_disable_unprepare(clock);
 		return -ENODEV;
+	}
 
 	if (is_ick)
 		t->ick = clock;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-14  8:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-14  8:40 [PATCH -next] clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock() Yang Yingliang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).