Skip to content

Commit cde50a6

Browse files
Levin, Alexander (Sasha Levin)ingomolnar
authored andcommitted
locking/rtmutex: Don't initialize lockdep when not required
pi_mutex isn't supposed to be tracked by lockdep, but just passing NULLs for name and key will cause lockdep to spew a warning and die, which is not what we want it to do. Skip lockdep initialization if the caller passed NULLs for name and key, suggesting such initialization isn't desired. Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: f569478 ("rt_mutex: Add lockdep annotations") Link: http://lkml.kernel.org/r/20170618140548.4763-1-alexander.levin@verizon.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 018956d commit cde50a6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎kernel/locking/rtmutex.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,8 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name,
16611661
lock->waiters = RB_ROOT;
16621662
lock->waiters_leftmost = NULL;
16631663

1664-
debug_rt_mutex_init(lock, name, key);
1664+
if (name && key)
1665+
debug_rt_mutex_init(lock, name, key);
16651666
}
16661667
EXPORT_SYMBOL_GPL(__rt_mutex_init);
16671668

0 commit comments

Comments
 (0)