From f05a427aa6b74acb5689ea18f990b40071008f8a Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Sun, 7 Sep 2003 11:14:52 +0000 Subject: [PATCH] Return EINVAL if the contested bit is not set on the umtx passed to _umtx_unlock() instead of firing a KASSERT. --- sys/kern/kern_umtx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 032f6b4dd88..cbd2e5ab3e5 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -265,7 +265,8 @@ _umtx_unlock(struct thread *td, struct _umtx_unlock_args *uap) return (EPERM); /* We should only ever be in here for contested locks */ - KASSERT((owner & UMTX_CONTESTED) != 0, ("contested umtx is not.")); + if ((owner & UMTX_CONTESTED) == 0) + return (EINVAL); blocked = NULL; /*