From fca542bcaab3c28addb4bbd8841703575e3bc968 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Sun, 1 Feb 2004 02:31:36 +0000 Subject: [PATCH] Move KASSERT regarding td_critnest to after the value of td is set to curthread, to avoid warning and incorrect behavior. Hoped not to mind: jeff --- sys/kern/kern_switch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index a8ead79984d..2776f7ee6f9 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -443,9 +443,8 @@ critical_exit(void) { struct thread *td; - KASSERT(td->td_critnest > 0, - ("critical_exit: critnest < 0")); td = curthread; + KASSERT(td->td_critnest > 0, ("critical_exit: critnest < 0")); if (td->td_critnest == 1) { td->td_critnest = 0; cpu_critical_exit();