diff --git a/sys/kern/kern_sa.c b/sys/kern/kern_sa.c index 764cb69bd1f1..59918b764581 100644 --- a/sys/kern/kern_sa.c +++ b/sys/kern/kern_sa.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sa.c,v 1.71 2006/03/29 23:02:31 cube Exp $ */ +/* $NetBSD: kern_sa.c,v 1.72 2006/04/13 18:55:49 christos Exp $ */ /*- * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #include "opt_ktrace.h" -__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.71 2006/03/29 23:02:31 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sa.c,v 1.72 2006/04/13 18:55:49 christos Exp $"); #include #include @@ -1693,14 +1693,14 @@ sa_vp_repossess(struct lwp *l) */ l2 = vp->savp_lwp; vp->savp_lwp = l; - if (l2->l_flag & L_SA_YIELD) - l2->l_flag &= ~(L_SA_YIELD|L_SA_IDLE); - - DPRINTFN(1,("sa_vp_repossess(%d.%d) vp lwp %d state %d\n", - p->p_pid, l->l_lid, l2->l_lid, l2->l_stat)); - - KDASSERT(l2 != l); if (l2) { + if (l2->l_flag & L_SA_YIELD) + l2->l_flag &= ~(L_SA_YIELD|L_SA_IDLE); + + DPRINTFN(1,("sa_vp_repossess(%d.%d) vp lwp %d state %d\n", + p->p_pid, l->l_lid, l2->l_lid, l2->l_stat)); + + KDASSERT(l2 != l); switch (l2->l_stat) { case LSRUN: remrunqueue(l2);