diff options
author | Dave Airlie <airlied@redhat.com> | 2017-03-23 03:05:13 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-03-23 03:05:13 +0100 |
commit | 65d1086c44791112188f6aebbdc3a27cab3736d3 (patch) | |
tree | f769c133e61c54e34e91aa9ecf1d3504a6eb4fb4 /kernel/locking/lockdep.c | |
parent | Merge tag 'drm-misc-next-2017-03-21' of git://anongit.freedesktop.org/git/drm... (diff) | |
parent | Linux 4.11-rc3 (diff) | |
download | linux-65d1086c44791112188f6aebbdc3a27cab3736d3.tar.xz linux-65d1086c44791112188f6aebbdc3a27cab3736d3.zip |
BackMerge tag 'v4.11-rc3' into drm-next
Linux 4.11-rc3 as requested by Daniel
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 508cbf31d43e..34e97d970761 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; } |