KVM: s390: introduce KMSG_COMPONENT for kvm-s390
[linux-2.6-microblaze.git] / arch / x86 / kernel / i387.c
index 367f39d..0091832 100644 (file)
@@ -341,7 +341,7 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
                unsigned int pos, unsigned int count,
                void *kbuf, void __user *ubuf)
 {
-       struct xsave_struct *xsave = &target->thread.fpu.state->xsave;
+       struct xsave_struct *xsave;
        int ret;
 
        if (!cpu_has_xsave)
@@ -351,6 +351,8 @@ int xstateregs_get(struct task_struct *target, const struct user_regset *regset,
        if (ret)
                return ret;
 
+       xsave = &target->thread.fpu.state->xsave;
+
        /*
         * Copy the 48bytes defined by the software first into the xstate
         * memory layout in the thread struct, so that we can copy the entire
@@ -369,7 +371,7 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
                  unsigned int pos, unsigned int count,
                  const void *kbuf, const void __user *ubuf)
 {
-       struct xsave_struct *xsave = &target->thread.fpu.state->xsave;
+       struct xsave_struct *xsave;
        int ret;
 
        if (!cpu_has_xsave)
@@ -379,6 +381,8 @@ int xstateregs_set(struct task_struct *target, const struct user_regset *regset,
        if (ret)
                return ret;
 
+       xsave = &target->thread.fpu.state->xsave;
+
        ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, xsave, 0, -1);
        /*
         * mxcsr reserved bits must be masked to zero for security reasons.