diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index ee38e88d9fcd..a8ead79984d7 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -443,6 +443,8 @@ critical_exit(void) { struct thread *td; + KASSERT(td->td_critnest > 0, + ("critical_exit: critnest < 0")); td = curthread; if (td->td_critnest == 1) { td->td_critnest = 0;