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

Commit 5e351ad1 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

locking/lockdep: Fix possible NULL deref



We can't invalidate xhlocks when we've not yet allocated any.

Reported-by: default avatarDmitry Vyukov <dvyukov@google.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Fixes: f52be570 ("locking/lockdep: Untangle xhlock history save/restore from task independence")
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 328b4ed9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4790,6 +4790,7 @@ void lockdep_invariant_state(bool force)
	 * Verify the former, enforce the latter.
	 */
	WARN_ON_ONCE(!force && current->lockdep_depth);
	if (current->xhlocks)
		invalidate_xhlock(&xhlock(current->xhlock_idx));
}