diff options
author | Tejun Heo <tj@kernel.org> | 2011-07-14 09:19:09 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-08-04 04:17:56 -0400 |
commit | f59de8992aa6dc85e81aadc26b0f69e17809721d (patch) | |
tree | 4cdb87598edb67a774281bf3cea2800114d2fa0c /kernel/lockdep.c | |
parent | 83835b3d9aec8e9f666d8223d8a386814f756266 (diff) |
lockdep: Clear whole lockdep_map on initialization
lockdep_init_map() only initializes parts of lockdep_map and triggers
kmemcheck warning when it is copied as a whole. There isn't anything
to be gained by clearing selectively. memset() the whole structure
and remove loop for ->class_cache[] clearing.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=35532
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Christian Casteyde <casteyde.christian@free.fr>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=35532
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110714131909.GJ3455@htj.dyndns.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r-- | kernel/lockdep.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 5903586f32a0..8c24294e477f 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2874,10 +2874,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
2874 | void lockdep_init_map(struct lockdep_map *lock, const char *name, | 2874 | void lockdep_init_map(struct lockdep_map *lock, const char *name, |
2875 | struct lock_class_key *key, int subclass) | 2875 | struct lock_class_key *key, int subclass) |
2876 | { | 2876 | { |
2877 | int i; | 2877 | memset(lock, 0, sizeof(*lock)); |
2878 | |||
2879 | for (i = 0; i < NR_LOCKDEP_CACHING_CLASSES; i++) | ||
2880 | lock->class_cache[i] = NULL; | ||
2881 | 2878 | ||
2882 | #ifdef CONFIG_LOCK_STAT | 2879 | #ifdef CONFIG_LOCK_STAT |
2883 | lock->cpu = raw_smp_processor_id(); | 2880 | lock->cpu = raw_smp_processor_id(); |