summaryrefslogtreecommitdiff
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-12-12 16:29:38 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-12 16:29:38 -0800
commitb9528b67a1b5055b4071734fabbe410461fb24a8 (patch)
tree01b490bca227a05e0d0b9b745cc6199a073967d6 /fs/proc/array.c
parent09775c85f777afee9ce408034e405837742319eb (diff)
[PATCH] do_task_stat() use pid_alive()
Use pid_alive() rather than testing for a zero value of ->pid. Is the right thing to do and addresses an oops dereferencing real_parent which one person reported. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index f5ad3980b0ff..ab3784acd70f 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -370,7 +370,7 @@ static int do_task_stat(struct task_struct *task, char * buffer, int whole)
stime += task->signal->stime;
}
}
- ppid = task->pid ? task->group_leader->real_parent->tgid : 0;
+ ppid = pid_alive(task) ? task->group_leader->real_parent->tgid : 0;
read_unlock(&tasklist_lock);
if (!whole || num_threads<2)