Merge tag 'objtool-core-2021-10-31' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / kernel / locking / lockdep.c
index 8a509672a4cc9a8b546f4c15d6c9d5f8ade10863..7096384dc60f1f0fa9218e4f4964310c9b99b352 100644 (file)
@@ -4671,7 +4671,7 @@ print_lock_invalid_wait_context(struct task_struct *curr,
 /*
  * Verify the wait_type context.
  *
- * This check validates we takes locks in the right wait-type order; that is it
+ * This check validates we take locks in the right wait-type order; that is it
  * ensures that we do not take mutexes inside spinlocks and do not attempt to
  * acquire spinlocks inside raw_spinlocks and the sort.
  *
@@ -5366,7 +5366,7 @@ int __lock_is_held(const struct lockdep_map *lock, int read)
                struct held_lock *hlock = curr->held_locks + i;
 
                if (match_held_lock(hlock, lock)) {
-                       if (read == -1 || hlock->read == read)
+                       if (read == -1 || !!hlock->read == read)
                                return LOCK_STATE_HELD;
 
                        return LOCK_STATE_NOT_HELD;