summaryrefslogtreecommitdiff
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 7722c15c1c5f..099a5be5ca65 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -319,6 +319,8 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk,
itimo = (timo == LK_TIMO_DEFAULT) ? lk->lk_timo : timo;
MPASS((flags & ~LK_TOTAL_MASK) == 0);
+ KASSERT((op & (op - 1)) == 0,
+ ("%s: Invalid requested operation @ %s:%d", __func__, file, line));
KASSERT((flags & (LK_NOWAIT | LK_SLEEPFAIL)) == 0 ||
(op != LK_DOWNGRADE && op != LK_RELEASE),
("%s: Invalid flags in regard of the operation desired @ %s:%d",
@@ -797,10 +799,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lock_object *ilk,
panic("%s: unknown lockmgr request 0x%x\n", __func__, op);
}
- /*
- * We could have exited from the switch without reacquiring the
- * interlock, so we need to check for the interlock ownership.
- */
if (flags & LK_INTERLOCK)
class->lc_unlock(ilk);