summaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@o2.pl>2007-02-20 22:58:00 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-21 02:10:14 +0100
commit60e114d1134555d1813e20a8cd86304331da05c7 (patch)
tree2cd482be7f82b8c2f6bf1fde7bcf288471e4cd6b /kernel/lockdep.c
parent[PATCH] cfag12864b: fix crash when built-in and no parport present (diff)
downloadlinux-60e114d1134555d1813e20a8cd86304331da05c7.tar.xz
linux-60e114d1134555d1813e20a8cd86304331da05c7.zip
[PATCH] lockdep: debug_locks check after check_chain_key
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 <jarkao2@o2.pl> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 592c576d77a7..a08a17218dfa 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2228,6 +2228,10 @@ out_calc_hash:
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");