diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 26b57e24476f19ee9409ee4f90463b9afa7036b0..0cbdbbb0729fa3cd43ba20560e527c8c2dc2b446 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3567,6 +3567,9 @@ __lock_set_class(struct lockdep_map *lock, const char *name, unsigned int depth; int i; + if (unlikely(!debug_locks)) + return 0; + depth = curr->lockdep_depth; /* * This function is about (re)setting the class of a held lock,