[PATCH] fix task_struct leak in ptrace
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Nov 2005 00:06:33 +0000 (16:06 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 14 Nov 2005 02:14:11 +0000 (18:14 -0800)
When ptrace_attach fails we need to drop the task_struct reference.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/ptrace.c

index b88d4186cd7ac2733c3adf231d5b4daa4e14b0a9..17ee7e5a34516f7485250b7a7ef94546907f9b39 100644 (file)
@@ -470,7 +470,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
 
        if (request == PTRACE_ATTACH) {
                ret = ptrace_attach(child);
-               goto out;
+               goto out_put_task_struct;
        }
 
        ret = ptrace_check_attach(child, request == PTRACE_KILL);