Skip to contentSkip to conversation

lockdep: debug_locks check after check_chain_key

PATCH New Jarek Poplawski 1 participant 1 message Feb 12, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

kernel/lockdep.c +4 -0
diff -Nurp linux-2.6.20-git7-/kernel/lockdep.c linux-2.6.20-git7/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");