|
@@ -3260,10 +3260,17 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
|
|
if (depth) {
|
|
if (depth) {
|
|
hlock = curr->held_locks + depth - 1;
|
|
hlock = curr->held_locks + depth - 1;
|
|
if (hlock->class_idx == class_idx && nest_lock) {
|
|
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++;
|
|
hlock->references++;
|
|
- else
|
|
|
|
|
|
+ } else {
|
|
hlock->references = 2;
|
|
hlock->references = 2;
|
|
|
|
+ }
|
|
|
|
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|