Skip to content

Commit 5b9e886

Browse files
Peter ZijlstraKAGA-KOKO
authored andcommitted
clocksource: Initialize cs->wd_list
A number of places relies on list_empty(&cs->wd_list), however the list_head does not get initialized. Do so upon registration, such that thereafter it is possible to rely on list_empty() correctly reflecting the list membership status. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Diego Viola <[email protected]> Reviewed-by: Rafael J. Wysocki <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 2aae7bc commit 5b9e886

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/time/clocksource.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ static void clocksource_resume_watchdog(void)
332332

333333
static void clocksource_enqueue_watchdog(struct clocksource *cs)
334334
{
335+
INIT_LIST_HEAD(&cs->wd_list);
336+
335337
if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
336338
/* cs is a clocksource to be watched. */
337339
list_add(&cs->wd_list, &watchdog_list);

0 commit comments

Comments
 (0)