]>
Commit | Line | Data |
---|---|---|
d11f37ce GKH |
1 | From 5b9e886a4af97574ca3ce1147f35545da0e7afc7 Mon Sep 17 00:00:00 2001 |
2 | From: Peter Zijlstra <peterz@infradead.org> | |
3 | Date: Mon, 30 Apr 2018 12:00:11 +0200 | |
4 | Subject: clocksource: Initialize cs->wd_list | |
5 | ||
6 | From: Peter Zijlstra <peterz@infradead.org> | |
7 | ||
8 | commit 5b9e886a4af97574ca3ce1147f35545da0e7afc7 upstream. | |
9 | ||
10 | A number of places relies on list_empty(&cs->wd_list), however the | |
11 | list_head does not get initialized. Do so upon registration, such that | |
12 | thereafter it is possible to rely on list_empty() correctly reflecting | |
13 | the list membership status. | |
14 | ||
15 | Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> | |
16 | Signed-off-by: Thomas Gleixner <tglx@linutronix.de> | |
17 | Tested-by: Diego Viola <diego.viola@gmail.com> | |
18 | Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | |
19 | Cc: stable@vger.kernel.org | |
20 | Cc: len.brown@intel.com | |
21 | Cc: rjw@rjwysocki.net | |
22 | Cc: rui.zhang@intel.com | |
23 | Link: https://lkml.kernel.org/r/20180430100344.472662715@infradead.org | |
24 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
25 | ||
26 | --- | |
27 | kernel/time/clocksource.c | 2 ++ | |
28 | 1 file changed, 2 insertions(+) | |
29 | ||
30 | --- a/kernel/time/clocksource.c | |
31 | +++ b/kernel/time/clocksource.c | |
32 | @@ -332,6 +332,8 @@ static void clocksource_resume_watchdog( | |
33 | ||
34 | static void clocksource_enqueue_watchdog(struct clocksource *cs) | |
35 | { | |
36 | + INIT_LIST_HEAD(&cs->wd_list); | |
37 | + | |
38 | if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) { | |
39 | /* cs is a clocksource to be watched. */ | |
40 | list_add(&cs->wd_list, &watchdog_list); |