Skip to content

Commit 16b3ae1

Browse files
Peter Zijlstragregkh
authored andcommitted
clocksource: Initialize cs->wd_list
commit 5b9e886 upstream. 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] Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a406abe commit 16b3ae1

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
@@ -322,6 +322,8 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
322322
{
323323
unsigned long flags;
324324

325+
INIT_LIST_HEAD(&cs->wd_list);
326+
325327
spin_lock_irqsave(&watchdog_lock, flags);
326328
if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
327329
/* cs is a clocksource to be watched. */

0 commit comments

Comments
 (0)