summaryrefslogtreecommitdiffstats
path: root/kernel/locking/lockdep.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-06 02:07:33 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-06 02:07:33 -0400
commit054838bc019c90511d034fb796dc8c7715460fc2 (patch)
treea04b9fa86e3cfb8adb285fcd33bd47983f75d8fb /kernel/locking/lockdep.c
parentd597580d373774b1bdab84b3d26ff0b55162b916 (diff)
parentfc69910f329d61821897871e0e957eda39beb3d8 (diff)
downloadop-kernel-dev-054838bc019c90511d034fb796dc8c7715460fc2.zip
op-kernel-dev-054838bc019c90511d034fb796dc8c7715460fc2.tar.gz
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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 12e38c2..a95e5d1 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;
}
OpenPOWER on IntegriCloud