diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/i387.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index da2adb4..6b722d3 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h @@ -175,7 +175,15 @@ static inline int save_i387(struct _fpstate __user *buf) */ static inline int restore_i387(struct _fpstate __user *buf) { - set_used_math(); + struct task_struct *tsk = current; + int err; + + if (!used_math()) { + err = init_fpu(tsk); + if (err) + return err; + } + if (!(task_thread_info(current)->status & TS_USEDFPU)) { clts(); task_thread_info(current)->status |= TS_USEDFPU; |