author: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 2021-09-03 10:40:01 +0200
committer: Minda Chen <minda.chen@starfivetech.com> 2023-11-06 19:24:38 +0800
commit: 7fde8a8ae18450b5397dea7a1e74e009d2d258af
parent: 66461f2c961b3a2a58cb0476f0d6c0d31e31ce65
Commit Summary:
Diffstat:
1 file changed, 1 insertion, 1 deletion
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index bf1c00c881e4..bfa0a347f27c 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -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;