]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/signal_64.c
Merge branches 'x86/prototypes', 'x86/x2apic' and 'x86/debug' into x86/core
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / signal_64.c
index 02b02583f5b5c08d3d0e33c82f5634ebfb9de4b2..2f14640500599f091720ab69ec61d44c072a7ebc 100644 (file)
@@ -105,7 +105,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;
 }
 
 /*