History

Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: lockdep: Fix wrong assumption in match_held_lock

Linus Torvalds committed 15 years ago

Commit 2da9f362 parents 950d0a1 80e04011 file · +7 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/lockdep.c+7−1
@@ -3111,7 +3111,13 @@ static int match_held_lock(struct held_lock *hlock, struct lockdep_map *lock) · 3110 unmodified lines
31113111 if (!class)
31123112 class = look_up_lock_class(lock, 0);
31133113
3114− if (DEBUG_LOCKS_WARN_ON(!class))
3114+ /*
3115+ * If look_up_lock_class() failed to find a class, we're trying
3116+ * to test if we hold a lock that has never yet been acquired.
3117+ * Clearly if the lock hasn't been acquired _ever_, we're not
3118+ * holding it either, so report failure.
3119+ */
3120+ if (!class)
31153121 return 0;
31163122
31173123 if (DEBUG_LOCKS_WARN_ON(!hlock->nest_lock))