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@
-/* $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 <art@openbsd.org>
*
KASSERT(ci != NULL);
SCHED_ASSERT_LOCKED();
+ KASSERT(p->p_wchan == NULL);
p->p_cpu = ci;
p->p_stat = SRUN;