aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/ptrace32.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
index 6612304e11e3..0f6eea086a23 100644
--- a/arch/powerpc/kernel/ptrace32.c
+++ b/arch/powerpc/kernel/ptrace32.c
@@ -85,33 +85,13 @@ static long compat_ptrace_old(struct task_struct *child, long request,
85 return ret; 85 return ret;
86} 86}
87 87
88long compat_sys_ptrace(int request, int pid, unsigned long addr, 88long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
89 unsigned long data) 89 compat_ulong_t caddr, compat_ulong_t cdata)
90{ 90{
91 struct task_struct *child; 91 unsigned long addr = caddr;
92 unsigned long data = cdata;
92 int ret; 93 int ret;
93 94
94 lock_kernel();
95 if (request == PTRACE_TRACEME) {
96 ret = ptrace_traceme();
97 goto out;
98 }
99
100 child = ptrace_get_task_struct(pid);
101 if (IS_ERR(child)) {
102 ret = PTR_ERR(child);
103 goto out;
104 }
105
106 if (request == PTRACE_ATTACH) {
107 ret = ptrace_attach(child);
108 goto out_tsk;
109 }
110
111 ret = ptrace_check_attach(child, request == PTRACE_KILL);
112 if (ret < 0)
113 goto out_tsk;
114
115 switch (request) { 95 switch (request) {
116 /* 96 /*
117 * Read 4 bytes of the other process' storage 97 * Read 4 bytes of the other process' storage
@@ -375,9 +355,6 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr,
375 ret = compat_ptrace_request(child, request, addr, data); 355 ret = compat_ptrace_request(child, request, addr, data);
376 break; 356 break;
377 } 357 }
378out_tsk: 358
379 put_task_struct(child);
380out:
381 unlock_kernel();
382 return ret; 359 return ret;
383} 360}