diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-06 02:07:33 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-04-06 02:07:33 -0400 |
commit | 054838bc019c90511d034fb796dc8c7715460fc2 (patch) | |
tree | a04b9fa86e3cfb8adb285fcd33bd47983f75d8fb /kernel/locking/lockdep.c | |
parent | d597580d373774b1bdab84b3d26ff0b55162b916 (diff) | |
parent | fc69910f329d61821897871e0e957eda39beb3d8 (diff) |
Merge commit 'fc69910f329d' into uaccess.mips
backmerge of a build fix from mainline
Diffstat (limited to 'kernel/locking/lockdep.c')
-rw-r--r-- | kernel/locking/lockdep.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 12e38c213b70..a95e5d1f4a9c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -3262,10 +3262,17 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, if (depth) { hlock = curr->held_locks + depth - 1; if (hlock->class_idx == class_idx && nest_lock) { - if (hlock->references) + if (hlock->references) { + /* + * Check: unsigned int references:12, overflow. + */ + if (DEBUG_LOCKS_WARN_ON(hlock->references == (1 << 12)-1)) + return 0; + hlock->references++; - else + } else { hlock->references = 2; + } return 1; } |