{
        struct user_fpsimd_state *uregs;
        compat_ulong_t fpscr;
-       int ret;
+       int ret, vregs_end_pos;
 
        uregs = &target->thread.fpsimd_state.user_fpsimd;
 
         * The VFP registers are packed into the fpsimd_state, so they all sit
         * nicely together for us. We just need to create the fpscr separately.
         */
-       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs, 0,
-                                 VFP_STATE_SIZE - sizeof(compat_ulong_t));
+       vregs_end_pos = VFP_STATE_SIZE - sizeof(compat_ulong_t);
+       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, uregs,
+                                 0, vregs_end_pos);
 
        if (count && !ret) {
                fpscr = (uregs->fpsr & VFP_FPSCR_STAT_MASK) |
                        (uregs->fpcr & VFP_FPSCR_CTRL_MASK);
-               ret = put_user(fpscr, (compat_ulong_t *)ubuf);
+
+               ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, &fpscr,
+                                         vregs_end_pos, VFP_STATE_SIZE);
        }
 
        return ret;