From 84d03f55f7b237a1b815440821f87aeecd4d02f7 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 16 Dec 2006 20:33:26 +0000 Subject: Fix NULL pointer reference for INVARIANTS case Submitted by: Yuriy Tsibizov --- sys/kern/subr_sleepqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/kern') diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index cc1fc89..4479d13 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -295,6 +295,7 @@ sleepq_add(void *wchan, struct lock_object *lock, const char *wmesg, int flags, * into the sleep queue already in use by this wait channel. */ if (sq == NULL) { + sq = td->td_sleepqueue; #ifdef INVARIANTS int i; for (i = 0; i < NR_SLEEPQS; i++) @@ -313,7 +314,6 @@ sleepq_add(void *wchan, struct lock_object *lock, const char *wmesg, int flags, sleepq_max_depth = sc->sc_max_depth; } #endif - sq = td->td_sleepqueue; LIST_INSERT_HEAD(&sc->sc_queues, sq, sq_hash); sq->sq_wchan = wchan; #ifdef INVARIANTS -- cgit v1.1