diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-01-11 16:16:10 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-01-11 16:16:12 +1100 |
commit | e130bc1d00a4a8597f18c31f2e75cd77a09fb7b1 (patch) | |
tree | c34476e5afc3d29e9b38373de097faa9597753b8 /kernel/ptrace.c | |
parent | e2d7fe89e8ae9ee56c560095b4fe8042c3e347cd (diff) | |
parent | 70286688e5ad172ebd9cd1fd468fd54361619479 (diff) |
Merge branch 'akpm-current/current'
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r-- | kernel/ptrace.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 58291e9f3276..d5dffecd783b 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c @@ -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; } @@ -1282,9 +1267,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; } |