When fp_thread is not NULL and is not the current thread, and fp_save() does not alter the machine state, check if ifps is NULL before setting fp_valid to avoid dereference of null pointer.
* i386/i386/fpu.c (ifps): Check if it's NULL. --- i386/i386/fpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index fb2c8ce..226f4ea 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -640,7 +640,8 @@ fphandleerr() */ clear_ts(); fp_save(fp_thread); - fp_thread->pcb->ims.ifps->fp_valid = 2; + if (fp_thread->pcb->ims.ifps != NULL) + fp_thread->pcb->ims.ifps->fp_valid = 2; fninit(); clear_fpu(); /* leave fp_intr_thread THREAD_NULL */ -- 1.8.1.4