diff options
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 7b6256bb590e..a1d1b2906e8d 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -610,15 +610,12 @@ static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp) | |||
610 | static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) | 610 | static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) |
611 | { | 611 | { |
612 | struct thread_info *thread = task_thread_info(tsk); | 612 | struct thread_info *thread = task_thread_info(tsk); |
613 | void *ptr = &thread->fpstate; | ||
614 | 613 | ||
615 | if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) | 614 | if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) |
616 | return -ENODATA; | 615 | return -ENODATA; |
617 | iwmmxt_task_disable(thread); /* force it to ram */ | 616 | iwmmxt_task_disable(thread); /* force it to ram */ |
618 | /* The iWMMXt state is stored doubleword-aligned. */ | 617 | return copy_to_user(ufp, &thread->fpstate.iwmmxt, IWMMXT_SIZE) |
619 | if (((long) ptr) & 4) | 618 | ? -EFAULT : 0; |
620 | ptr += 4; | ||
621 | return copy_to_user(ufp, ptr, 0x98) ? -EFAULT : 0; | ||
622 | } | 619 | } |
623 | 620 | ||
624 | /* | 621 | /* |
@@ -627,15 +624,12 @@ static int ptrace_getwmmxregs(struct task_struct *tsk, void __user *ufp) | |||
627 | static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) | 624 | static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) |
628 | { | 625 | { |
629 | struct thread_info *thread = task_thread_info(tsk); | 626 | struct thread_info *thread = task_thread_info(tsk); |
630 | void *ptr = &thread->fpstate; | ||
631 | 627 | ||
632 | if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) | 628 | if (!test_ti_thread_flag(thread, TIF_USING_IWMMXT)) |
633 | return -EACCES; | 629 | return -EACCES; |
634 | iwmmxt_task_release(thread); /* force a reload */ | 630 | iwmmxt_task_release(thread); /* force a reload */ |
635 | /* The iWMMXt state is stored doubleword-aligned. */ | 631 | return copy_from_user(&thread->fpstate.iwmmxt, ufp, IWMMXT_SIZE) |
636 | if (((long) ptr) & 4) | 632 | ? -EFAULT : 0; |
637 | ptr += 4; | ||
638 | return copy_from_user(ptr, ufp, 0x98) ? -EFAULT : 0; | ||
639 | } | 633 | } |
640 | 634 | ||
641 | #endif | 635 | #endif |