diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-20 11:52:15 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-20 11:52:15 +0200 |
commit | 7393423dd9b5790a3115873be355e9fc862bce8f (patch) | |
tree | fc83214602c8ce41dc06d5c8e21deada679521f7 /arch/x86/kernel/signal_64.c | |
parent | x86: <asm/asm.h> consistency cleanups (diff) | |
parent | Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/... (diff) | |
download | linux-7393423dd9b5790a3115873be355e9fc862bce8f.tar.xz linux-7393423dd9b5790a3115873be355e9fc862bce8f.zip |
Merge branch 'linus' into x86/cleanups
Diffstat (limited to 'arch/x86/kernel/signal_64.c')
-rw-r--r-- | arch/x86/kernel/signal_64.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kernel/signal_64.c b/arch/x86/kernel/signal_64.c index 87a9c2f28d99..162da796a323 100644 --- a/arch/x86/kernel/signal_64.c +++ b/arch/x86/kernel/signal_64.c @@ -100,7 +100,16 @@ static inline int restore_i387(struct _fpstate __user *buf) clts(); task_thread_info(current)->status |= TS_USEDFPU; } - return restore_fpu_checking((__force struct i387_fxsave_struct *)buf); + err = restore_fpu_checking((__force struct i387_fxsave_struct *)buf); + if (unlikely(err)) { + /* + * Encountered an error while doing the restore from the + * user buffer, clear the fpu state. + */ + clear_fpu(tsk); + clear_used_math(); + } + return err; } /* |