diff --git a/sys/kern/kern_sx.c b/sys/kern/kern_sx.c index ea7d03641cb3..2a25fdcbe0fd 100644 --- a/sys/kern/kern_sx.c +++ b/sys/kern/kern_sx.c @@ -277,7 +277,7 @@ _sx_sunlock(struct sx *sx, const char *file, int line) curthread->td_locks--; WITNESS_UNLOCK(&sx->lock_object, 0, file, line); LOCK_LOG_LOCK("SUNLOCK", &sx->lock_object, 0, 0, file, line); - if (SX_SHARERS(sx->sx_lock) == 0) + if (SX_SHARERS(sx->sx_lock) == 1) lock_profile_release_lock(&sx->lock_object); __sx_sunlock(sx, file, line); }