Skip to contentSkip to conversation

clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()

PATCH Superseded Yang Yingliang 1 participant 1 message May 14, 2022 Clocksource, clockevent drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()

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

---
 drivers/clocksource/timer-ti-dm-systimer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/timer-ti-dm-systimer.c +3 -1
index 2737407ff069..632523c1232f 100644
@@ -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;
Signature · 1 line
2.25.1