summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2018-04-30 12:00:11 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-22 14:28:48 +0200
commit16b3ae12337eb1695de0031fe4e030fb7fd6c2d9 (patch)
tree93264d298a9bfed2a66302388883341d615bcc90
parenta406abeb7416501355668222164919836da67034 (diff)
downloadlinux-stable-16b3ae12337eb1695de0031fe4e030fb7fd6c2d9.tar.gz
linux-stable-16b3ae12337eb1695de0031fe4e030fb7fd6c2d9.tar.bz2
linux-stable-16b3ae12337eb1695de0031fe4e030fb7fd6c2d9.zip
clocksource: Initialize cs->wd_list
commit 5b9e886a4af97574ca3ce1147f35545da0e7afc7 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) <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 Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--kernel/time/clocksource.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index 03918a19cf2d..3b71d859ee38 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -322,6 +322,8 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
{
unsigned long flags;
+ INIT_LIST_HEAD(&cs->wd_list);
+
spin_lock_irqsave(&watchdog_lock, flags);
if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
/* cs is a clocksource to be watched. */