Merge branch 'stable/bug-fixes-for-rc7' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / sh / kernel / ptrace_32.c
index 90a15d2..3d7b209 100644 (file)
@@ -101,6 +101,8 @@ static int set_single_step(struct task_struct *tsk, unsigned long addr)
 
                attr = bp->attr;
                attr.bp_addr = addr;
+               /* reenable breakpoint */
+               attr.disabled = false;
                err = modify_user_hw_breakpoint(bp, &attr);
                if (unlikely(err))
                        return err;
@@ -115,7 +117,11 @@ void user_enable_single_step(struct task_struct *child)
 
        set_tsk_thread_flag(child, TIF_SINGLESTEP);
 
+       if (ptrace_get_breakpoints(child) < 0)
+               return;
+
        set_single_step(child, pc);
+       ptrace_put_breakpoints(child);
 }
 
 void user_disable_single_step(struct task_struct *child)
@@ -392,6 +398,9 @@ long arch_ptrace(struct task_struct *child, long request,
                                        tmp = 0;
                        } else {
                                unsigned long index;
+                               ret = init_fpu(child);
+                               if (ret)
+                                       break;
                                index = addr - offsetof(struct user, fpu);
                                tmp = ((unsigned long *)child->thread.xstate)
                                        [index >> 2];
@@ -423,6 +432,9 @@ long arch_ptrace(struct task_struct *child, long request,
                else if (addr >= offsetof(struct user, fpu) &&
                         addr < offsetof(struct user, u_fpvalid)) {
                        unsigned long index;
+                       ret = init_fpu(child);
+                       if (ret)
+                               break;
                        index = addr - offsetof(struct user, fpu);
                        set_stopped_child_used_math(child);
                        ((unsigned long *)child->thread.xstate)