clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
PATCH v2 1/1 clocksource/drivers/timer-ti-dm: fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
If clk_get_rate() fails which is called after clk_prepare_enable(), clk_disable_unprepare() need be called in error path to disable the clock in dmtimer_systimer_init_clock().
---
v1 -> v2:
Add fix tag.
v1 patch link:
https://lore.kernel.org/lkml/[email protected]/
--- drivers/clocksource/timer-ti-dm-systimer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/timer-ti-dm-systimer.c +3 -1
@@ -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
Quoted 3 lines · Yang Yingliang
If
clk_get_rate()fails which is called afterclk_prepare_enable(),clk_disable_unprepare()need be called in error path to disable the clock indmtimer_systimer_init_clock().
[tip: timers/core] clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
In reply to Yang YingliangThe following commit has been merged into the timers/core branch of tip:
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 180d35a7c05d520314a590c99ad8643d0213f28b Gitweb: https://git.kernel.org/tip/180d35a7c05d520314a590c99ad8643d0213f28b Author: Yang Yingliang <[email protected]> AuthorDate: Sat, 29 Oct 2022 19:44:27 +08:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Fri, 02 Dec 2022 13:16:46 +01:00
clocksource/drivers/timer-ti-dm: Fix missing clk_disable_unprepare in dmtimer_systimer_init_clock()
If clk_get_rate() fails which is called after clk_prepare_enable(), clk_disable_unprepare() need be called in error path to disable the clock in dmtimer_systimer_init_clock().
--- drivers/clocksource/timer-ti-dm-systimer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clocksource/timer-ti-dm-systimer.c +3 -1
@@ -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;