Correctly check for casueword(9) success in do_set_ceiling().

After r349951, the return code must be checked instead of old == new
comparision.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	12 days
Differential revision:	https://reviews.freebsd.org/D20949
This commit is contained in:
kib 2019-07-15 08:38:01 +00:00
parent f5ae3e40c9
commit 97d74e089b

View File

@ -2456,7 +2456,8 @@ do_set_ceiling(struct thread *td, struct umutex *m, uint32_t ceiling,
break;
}
if (owner == UMUTEX_CONTESTED) {
if (rv == 0) {
MPASS(owner == UMUTEX_CONTESTED);
rv = suword32(&m->m_ceilings[0], ceiling);
rv1 = suword32(&m->m_owner, UMUTEX_CONTESTED);
error = (rv == 0 && rv1 == 0) ? 0: EFAULT;