Commit b42e737e authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

lockdep: fix overflow in the hlock shrinkage code

There is a overflow by 1 case in the new shrunken hlock code.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 3295f0ef
...@@ -191,7 +191,12 @@ struct lock_chain { ...@@ -191,7 +191,12 @@ struct lock_chain {
}; };
#define MAX_LOCKDEP_KEYS_BITS 11 #define MAX_LOCKDEP_KEYS_BITS 11
#define MAX_LOCKDEP_KEYS (1UL << MAX_LOCKDEP_KEYS_BITS) /*
* Subtract one because we offset hlock->class_idx by 1 in order
* to make 0 mean no class. This avoids overflowing the class_idx
* bitfield and hitting the BUG in hlock_class().
*/
#define MAX_LOCKDEP_KEYS ((1UL << MAX_LOCKDEP_KEYS_BITS) - 1)
struct held_lock { struct held_lock {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment