From 7a27809dea21ae1f404cb0c9f01283d97a8708d0 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 16 Oct 2003 21:13:14 +0000 Subject: [PATCH] - The kse may be null in sched_pctcpu(). Reported by: kris --- sys/kern/sched_4bsd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 542dce4dcd14..6480b4995739 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -723,5 +723,11 @@ sched_sizeof_thread(void) fixpt_t sched_pctcpu(struct thread *td) { - return (td->td_kse->ke_pctcpu); + struct kse *ke; + + ke = td->td_kse; + if (ke) + return (ke->ke_pctcpu); + + return (0); }