diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2022-10-29 19:44:27 +0800 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@kernel.org> | 2022-12-02 13:16:46 +0100 |
commit | 180d35a7c05d520314a590c99ad8643d0213f28b (patch) | |
tree | 4e6e25a38df6044e01de97ac8cb44ece014a1e53 /drivers/clocksource | |
parent | 822963b96dfdb72ec4fb1395fbdfa778656b49d1 (diff) |
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().
Fixes: 52762fbd1c47 ("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20221029114427.946520-1-yangyingliang@huawei.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r-- | drivers/clocksource/timer-ti-dm-systimer.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |