Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b9e886a authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Thomas Gleixner
Browse files

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: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarDiego Viola <diego.viola@gmail.com>
Reviewed-by: default avatarRafael 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
parent 2aae7bcf
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -332,6 +332,8 @@ static void clocksource_resume_watchdog(void)


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

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