From ad8b1d857de87353993df347036353a8609019f3 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 18 Apr 2015 17:21:12 +0000 Subject: [PATCH] Initialize td_sel in the thread_init(). Struct thread is not zeroed on the initial allocation, but seltdinit() assumes that td_sel is NULL or a valid pointer. Note that thread_fini()/seltdfini() also relies on this, but correctly resets td_sel to NULL. Submitted by: luke.tw@gmail.com PR: 199518 MFC after: 1 week --- sys/kern/kern_thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index dd11e5cff083..0a93dbded5c1 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -209,6 +209,7 @@ thread_init(void *mem, int size, int flags) td->td_sched = (struct td_sched *)&td[1]; umtx_thread_init(td); td->td_kstack = 0; + td->td_sel = NULL; return (0); }