diff options
Diffstat (limited to 'kernel/mutex-debug.c')
-rw-r--r-- | kernel/mutex-debug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/mutex-debug.c b/kernel/mutex-debug.c index 5569766a1ea2..e3203c654dda 100644 --- a/kernel/mutex-debug.c +++ b/kernel/mutex-debug.c | |||
@@ -83,12 +83,16 @@ void debug_mutex_unlock(struct mutex *lock) | |||
83 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); | 83 | DEBUG_LOCKS_WARN_ON(lock->owner != current_thread_info()); |
84 | } | 84 | } |
85 | 85 | ||
86 | void debug_mutex_init(struct mutex *lock, const char *name) | 86 | void debug_mutex_init(struct mutex *lock, const char *name, |
87 | struct lock_class_key *key) | ||
87 | { | 88 | { |
89 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
88 | /* | 90 | /* |
89 | * Make sure we are not reinitializing a held lock: | 91 | * Make sure we are not reinitializing a held lock: |
90 | */ | 92 | */ |
91 | debug_check_no_locks_freed((void *)lock, sizeof(*lock)); | 93 | debug_check_no_locks_freed((void *)lock, sizeof(*lock)); |
94 | lockdep_init_map(&lock->dep_map, name, key); | ||
95 | #endif | ||
92 | lock->owner = NULL; | 96 | lock->owner = NULL; |
93 | lock->magic = lock; | 97 | lock->magic = lock; |
94 | } | 98 | } |