]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/ptrace.c
h63xx: tsc2101 alsa sound support
[linux-2.6-omap-h63xx.git] / kernel / ptrace.c
index cceaf09ac413a4da1b9ea3d27d7655cb405e785c..d95a72c9279dc2e1110d31c0dadacc39b30b198f 100644 (file)
@@ -7,6 +7,7 @@
  * to continually duplicate across every architecture.
  */
 
+#include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
@@ -71,8 +72,8 @@ void ptrace_untrace(task_t *child)
  */
 void __ptrace_unlink(task_t *child)
 {
-       if (!child->ptrace)
-               BUG();
+       BUG_ON(!child->ptrace);
+
        child->ptrace = 0;
        if (!list_empty(&child->ptrace_list)) {
                list_del_init(&child->ptrace_list);
@@ -183,22 +184,27 @@ bad:
        return retval;
 }
 
+void __ptrace_detach(struct task_struct *child, unsigned int data)
+{
+       child->exit_code = data;
+       /* .. re-parent .. */
+       __ptrace_unlink(child);
+       /* .. and wake it up. */
+       if (child->exit_state != EXIT_ZOMBIE)
+               wake_up_process(child);
+}
+
 int ptrace_detach(struct task_struct *child, unsigned int data)
 {
        if (!valid_signal(data))
-               return  -EIO;
+               return -EIO;
 
        /* Architecture-specific hardware disable .. */
        ptrace_disable(child);
 
-       /* .. re-parent .. */
-       child->exit_code = data;
-
        write_lock_irq(&tasklist_lock);
-       __ptrace_unlink(child);
-       /* .. and wake it up. */
-       if (child->exit_state != EXIT_ZOMBIE)
-               wake_up_process(child);
+       if (child->ptrace)
+               __ptrace_detach(child, data);
        write_unlock_irq(&tasklist_lock);
 
        return 0;
@@ -241,8 +247,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
                if (write) {
                        copy_to_user_page(vma, page, addr,
                                          maddr + offset, buf, bytes);
-                       if (!PageCompound(page))
-                               set_page_dirty_lock(page);
+                       set_page_dirty_lock(page);
                } else {
                        copy_from_user_page(vma, page, addr,
                                            buf, maddr + offset, bytes);