diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 92e229e81ec8..f2aa3e06f9c0 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -522,6 +522,10 @@ maybe_preempt(struct thread *td) * to the new thread. */ ctd = curthread; + + if ((ctd->td_kse == NULL) || (ctd->td_kse->ke_thread != ctd)) + return (0); + pri = td->td_priority; cpri = ctd->td_priority; if (pri >= cpri || cold /* || dumping */ || TD_IS_INHIBITED(ctd) ||