Skip to content

Commit

Permalink
clocksource: Initialize cs->wd_list
Browse files Browse the repository at this point in the history
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) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Diego Viola <diego.viola@gmail.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: stable@vger.kernel.org
Cc: len.brown@intel.com
Cc: rjw@rjwysocki.net
Cc: rui.zhang@intel.com
Link: https://lkml.kernel.org/r/20180430100344.472662715@infradead.org
  • Loading branch information
Peter Zijlstra authored and KAGA-KOKO committed May 2, 2018
1 parent 2aae7bc commit 5b9e886
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/time/clocksource.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ static void clocksource_resume_watchdog(void)

static void clocksource_enqueue_watchdog(struct clocksource *cs)
{
INIT_LIST_HEAD(&cs->wd_list);

if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
/* cs is a clocksource to be watched. */
list_add(&cs->wd_list, &watchdog_list);
Expand Down

0 comments on commit 5b9e886

Please sign in to comment.