diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/process.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index bfc99b3b6522..6e338e3b1dc0 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -156,11 +156,13 @@ void flush_thread(void) | |||
156 | /* FPU state will be reallocated lazily at the first use. */ | 156 | /* FPU state will be reallocated lazily at the first use. */ |
157 | drop_fpu(tsk); | 157 | drop_fpu(tsk); |
158 | free_thread_xstate(tsk); | 158 | free_thread_xstate(tsk); |
159 | } else if (!used_math()) { | 159 | } else { |
160 | /* kthread execs. TODO: cleanup this horror. */ | 160 | if (!tsk_used_math(tsk)) { |
161 | if (WARN_ON(init_fpu(tsk))) | 161 | /* kthread execs. TODO: cleanup this horror. */ |
162 | force_sig(SIGKILL, tsk); | 162 | if (WARN_ON(init_fpu(tsk))) |
163 | user_fpu_begin(); | 163 | force_sig(SIGKILL, tsk); |
164 | user_fpu_begin(); | ||
165 | } | ||
164 | restore_init_xstate(); | 166 | restore_init_xstate(); |
165 | } | 167 | } |
166 | } | 168 | } |