From: claudio Date: Tue, 19 Sep 2023 11:31:51 +0000 (+0000) Subject: Add a KASSERT for p->p_wchan == NULL to setrunqueue() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=709f95964c86ed2960242cd7d1d5d52d9707c231;p=openbsd Add a KASSERT for p->p_wchan == NULL to setrunqueue() There is the same check in sched_chooseproc() but that is too late to know where the bad insertion into the runqueue was done. OK mpi@ --- diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 8d043f5dc68..c4a00effa39 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.91 2023/09/14 22:07:11 cheloha Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.92 2023/09/19 11:31:51 claudio Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski * @@ -268,6 +268,7 @@ setrunqueue(struct cpu_info *ci, struct proc *p, uint8_t prio) KASSERT(ci != NULL); SCHED_ASSERT_LOCKED(); + KASSERT(p->p_wchan == NULL); p->p_cpu = ci; p->p_stat = SRUN;