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

Commit 2f996ae5 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "timers: Plug locking race vs. timer migration"

parents b21cbc36 8965291e
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -811,8 +811,15 @@ static struct tvec_base *lock_timer_base(struct timer_list *timer,
	__acquires(timer->base->lock)
{
	for (;;) {
		u32 tf = timer->flags;
		struct tvec_base *base;
		u32 tf;

		/*
		 * We need to use READ_ONCE() here, otherwise the compiler
		 * might re-read @tf between the check for TIMER_MIGRATING
		 * and spin_lock().
		 */
		tf = READ_ONCE(timer->flags);

		if (!(tf & TIMER_MIGRATING)) {
			base = get_timer_base(tf);