]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/ptrace.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / ptrace.c
index 7673e98657330dd7f90dd4d29f569d4ea2ca10e8..2a9fe97e452129c9cd843e8e404d327df8605f66 100644 (file)
@@ -530,15 +530,21 @@ static int gpr32_set(struct task_struct *target,
                --count;
        }
 
-       if (kbuf)
+       if (kbuf) {
                for (; count > 0 && pos <= PT_MAX_PUT_REG; --count)
                        regs[pos++] = *k++;
-       else
+               for (; count > 0 && pos < PT_TRAP; --count, ++pos)
+                       ++k;
+       } else {
                for (; count > 0 && pos <= PT_MAX_PUT_REG; --count) {
                        if (__get_user(reg, u++))
                                return -EFAULT;
                        regs[pos++] = reg;
                }
+               for (; count > 0 && pos < PT_TRAP; --count, ++pos)
+                       if (__get_user(reg, u++))
+                               return -EFAULT;
+       }
 
        if (count > 0 && pos == PT_TRAP) {
                if (kbuf)