diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2008-08-11 06:34:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-11 06:34:42 -0400 |
commit | b42e737e576339c795d9ac77a1fce6057f6bc0cf (patch) | |
tree | 05aa0ba4f7dfd8d8a5ac3dc85893c18a20f159d3 | |
parent | 3295f0ef9ff048a4619ede597ad9ec9cab725654 (diff) |
lockdep: fix overflow in the hlock shrinkage code
There is a overflow by 1 case in the new shrunken hlock code.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/lockdep.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 67f42b300c65..c88aa3d8e87f 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -191,7 +191,12 @@ struct lock_chain { | |||
191 | }; | 191 | }; |
192 | 192 | ||
193 | #define MAX_LOCKDEP_KEYS_BITS 11 | 193 | #define MAX_LOCKDEP_KEYS_BITS 11 |
194 | #define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS) | 194 | /* |
195 | * Subtract one because we offset hlock->class_idx by 1 in order | ||
196 | * to make 0 mean no class. This avoids overflowing the class_idx | ||
197 | * bitfield and hitting the BUG in hlock_class(). | ||
198 | */ | ||
199 | #define MAX_LOCKDEP_KEYS ((1UL << MAX_LOCKDEP_KEYS_BITS) - 1) | ||
195 | 200 | ||
196 | struct held_lock { | 201 | struct held_lock { |
197 | /* | 202 | /* |