diff options
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 47b201ecc6df..8bbeef996c76 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2492,13 +2492,20 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
2492 | void lockdep_init_map(struct lockdep_map *lock, const char *name, | 2492 | void lockdep_init_map(struct lockdep_map *lock, const char *name, |
2493 | struct lock_class_key *key, int subclass) | 2493 | struct lock_class_key *key, int subclass) |
2494 | { | 2494 | { |
2495 | if (unlikely(!debug_locks)) | 2495 | lock->class_cache = NULL; |
2496 | #ifdef CONFIG_LOCK_STAT | ||
2497 | lock->cpu = raw_smp_processor_id(); | ||
2498 | #endif | ||
2499 | |||
2500 | if (DEBUG_LOCKS_WARN_ON(!name)) { | ||
2501 | lock->name = "NULL"; | ||
2496 | return; | 2502 | return; |
2503 | } | ||
2504 | |||
2505 | lock->name = name; | ||
2497 | 2506 | ||
2498 | if (DEBUG_LOCKS_WARN_ON(!key)) | 2507 | if (DEBUG_LOCKS_WARN_ON(!key)) |
2499 | return; | 2508 | return; |
2500 | if (DEBUG_LOCKS_WARN_ON(!name)) | ||
2501 | return; | ||
2502 | /* | 2509 | /* |
2503 | * Sanity check, the lock-class key must be persistent: | 2510 | * Sanity check, the lock-class key must be persistent: |
2504 | */ | 2511 | */ |
@@ -2507,12 +2514,11 @@ void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
2507 | DEBUG_LOCKS_WARN_ON(1); | 2514 | DEBUG_LOCKS_WARN_ON(1); |
2508 | return; | 2515 | return; |
2509 | } | 2516 | } |
2510 | lock->name = name; | ||
2511 | lock->key = key; | 2517 | lock->key = key; |
2512 | lock->class_cache = NULL; | 2518 | |
2513 | #ifdef CONFIG_LOCK_STAT | 2519 | if (unlikely(!debug_locks)) |
2514 | lock->cpu = raw_smp_processor_id(); | 2520 | return; |
2515 | #endif | 2521 | |
2516 | if (subclass) | 2522 | if (subclass) |
2517 | register_lock_class(lock, subclass, 1); | 2523 | register_lock_class(lock, subclass, 1); |
2518 | } | 2524 | } |