From 484288de56f7be21d20c1bc74cb7a0e0bf188a97 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Mon, 20 Oct 2003 19:55:21 +0000 Subject: [PATCH] - If a thread is not bound to a kse return 0 from sched_pctcpu(). Reported by: pawel.worach@nordea.com --- sys/kern/sched_ule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 1f79439c1167..ccd7bddd8821 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1311,6 +1311,8 @@ sched_pctcpu(struct thread *td) pctcpu = 0; ke = td->td_kse; + if (ke == NULL) + return (0); mtx_lock_spin(&sched_lock); if (ke->ke_ticks) {