diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 4d362d3e4571..2f0f5720b123 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -4777,7 +4777,8 @@ void lockdep_invariant_state(bool force) * Verify the former, enforce the latter. */ WARN_ON_ONCE(!force && current->lockdep_depth); - invalidate_xhlock(&xhlock(current->xhlock_idx)); + if (current->xhlocks) + invalidate_xhlock(&xhlock(current->xhlock_idx)); } static int cross_lock(struct lockdep_map *lock)