diff options
| -rw-r--r-- | arch/powerpc/kernel/align.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 5af4e9b2dbe..ada06924a42 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
| @@ -646,11 +646,16 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, | |||
| 646 | unsigned int areg, struct pt_regs *regs, | 646 | unsigned int areg, struct pt_regs *regs, |
| 647 | unsigned int flags, unsigned int length) | 647 | unsigned int flags, unsigned int length) |
| 648 | { | 648 | { |
| 649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 649 | char *ptr; |
| 650 | int ret = 0; | 650 | int ret = 0; |
| 651 | 651 | ||
| 652 | flush_vsx_to_thread(current); | 652 | flush_vsx_to_thread(current); |
| 653 | 653 | ||
| 654 | if (reg < 32) | ||
| 655 | ptr = (char *) ¤t->thread.TS_FPR(reg); | ||
| 656 | else | ||
| 657 | ptr = (char *) ¤t->thread.vr[reg - 32]; | ||
| 658 | |||
| 654 | if (flags & ST) | 659 | if (flags & ST) |
| 655 | ret = __copy_to_user(addr, ptr, length); | 660 | ret = __copy_to_user(addr, ptr, length); |
| 656 | else { | 661 | else { |
