Skip to content

Commit

Permalink
[PATCH] lockdep: debug_locks check after check_chain_key
Browse files Browse the repository at this point in the history
In __lock_acquire check_chain_key can turn off debug_locks, so check is
needed to assure proper return code.

Signed-off-by: Jarek Poplawski <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Jarek Poplawski authored and Linus Torvalds committed Feb 21, 2007
1 parent 34173a4 commit 60e114d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,10 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,

curr->lockdep_depth++;
check_chain_key(curr);
#ifdef CONFIG_DEBUG_LOCKDEP
if (unlikely(!debug_locks))
return 0;
#endif
if (unlikely(curr->lockdep_depth >= MAX_LOCK_DEPTH)) {
debug_locks_off();
printk("BUG: MAX_LOCK_DEPTH too low!\n");
Expand Down

0 comments on commit 60e114d

Please sign in to comment.