diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index be1c42e8ee0a..9464588b9eda 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -755,7 +755,7 @@ __rw_runlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v, x)) { turnstile_chain_unlock(&rw->lock_object); - x = RW_READ_VALUE(rw); + v = RW_READ_VALUE(rw); continue; } if (LOCK_LOG_TEST(&rw->lock_object, 0))