Date: Mon, 15 Jul 2019 08:38:01 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r349994 - head/sys/kern Message-ID: <201907150838.x6F8c1mu095490@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jul 15 08:38:01 2019 New Revision: 349994 URL: https://svnweb.freebsd.org/changeset/base/349994 Log: 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 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jul 15 08:21:49 2019 (r349993) +++ head/sys/kern/kern_umtx.c Mon Jul 15 08:38:01 2019 (r349994) @@ -2456,7 +2456,8 @@ do_set_ceiling(struct thread *td, struct umutex *m, ui 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907150838.x6F8c1mu095490>