Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[sfrench/cifs-2.6.git] / kernel / ptrace.c
index 5e1d713c8e61f92e77fd0b3e4f46a678f2500a15..21fec73d45d4e9692a73af4b65109fcd20f94531 100644 (file)
@@ -1103,21 +1103,6 @@ int ptrace_request(struct task_struct *child, long request,
        return ret;
 }
 
-static struct task_struct *ptrace_get_task_struct(pid_t pid)
-{
-       struct task_struct *child;
-
-       rcu_read_lock();
-       child = find_task_by_vpid(pid);
-       if (child)
-               get_task_struct(child);
-       rcu_read_unlock();
-
-       if (!child)
-               return ERR_PTR(-ESRCH);
-       return child;
-}
-
 #ifndef arch_ptrace_attach
 #define arch_ptrace_attach(child)      do { } while (0)
 #endif
@@ -1135,9 +1120,9 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr,
                goto out;
        }
 
-       child = ptrace_get_task_struct(pid);
-       if (IS_ERR(child)) {
-               ret = PTR_ERR(child);
+       child = find_get_task_by_vpid(pid);
+       if (!child) {
+               ret = -ESRCH;
                goto out;
        }
 
@@ -1281,9 +1266,9 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_long_t, request, compat_long_t, pid,
                goto out;
        }
 
-       child = ptrace_get_task_struct(pid);
-       if (IS_ERR(child)) {
-               ret = PTR_ERR(child);
+       child = find_get_task_by_vpid(pid);
+       if (!child) {
+               ret = -ESRCH;
                goto out;
        }