diff options
author | mtm <mtm@FreeBSD.org> | 2003-07-19 11:32:48 +0000 |
---|---|---|
committer | mtm <mtm@FreeBSD.org> | 2003-07-19 11:32:48 +0000 |
commit | c986a2c5cf63808bad6a82726dcd33b8f17317c0 (patch) | |
tree | 67a834dd5cc1f0b1b4d0b73270beece2e6d70ec4 /sys/kern/kern_umtx.c | |
parent | 3df3357f0f83f520516650d007105e01150e2228 (diff) | |
download | FreeBSD-src-c986a2c5cf63808bad6a82726dcd33b8f17317c0.zip FreeBSD-src-c986a2c5cf63808bad6a82726dcd33b8f17317c0.tar.gz |
Turn a KASSERT back into an EINVAL return value. So, next time someone
comes across it, it will turn into a core dump in userland instead of
a kernel panic. I had also inverted the sense of the test, so
Double pointy hat to: mtm
Diffstat (limited to 'sys/kern/kern_umtx.c')
-rw-r--r-- | sys/kern/kern_umtx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index f0a99e3..05c6577 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -282,7 +282,8 @@ _umtx_unlock(struct thread *td, struct _umtx_unlock_args *uap) UMTX_UNOWNED); if (old == -1) return (EFAULT); - KASSERT(old != owner, ("improper umtx access")); + if (old != owner) + return (EINVAL); /* * Recheck the umtx queue to make sure another thread @@ -303,7 +304,8 @@ _umtx_unlock(struct thread *td, struct _umtx_unlock_args *uap) UMTX_UNLOCK(); old = casuptr((intptr_t *)&umtx->u_owner, owner, UMTX_CONTESTED); - KASSERT(old != -1 && old != owner, ("improper umtx access")); + if (old != -1 && old != owner) + return (EINVAL); } if (old == -1) |