Commit b9528b67 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 09775c85
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment