From: Oleg Nesterov Date: Tue, 21 Apr 2020 10:19:04 +0000 (+0200) Subject: remove the no longer needed pid_alive() check in __task_pid_nr_ns() X-Git-Tag: v5.10.7~2328^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1dd694a1b72f69a3add938f4b5bfb4cf9914b133;p=platform%2Fkernel%2Flinux-rpi.git remove the no longer needed pid_alive() check in __task_pid_nr_ns() Starting from 2c4704756cab ("pids: Move the pgrp and session pid pointers from task_struct to signal_struct") __task_pid_nr_ns() doesn't dereference task->group_leader, we can remove the pid_alive() check. pid_nr_ns() has to check pid != NULL anyway, pid_alive() just adds the unnecessary confusion. Signed-off-by: Oleg Nesterov Reviewed-by: "Eric W. Biederman" Acked-by: Christian Brauner Signed-off-by: Eric W. Biederman --- diff --git a/kernel/pid.c b/kernel/pid.c index 6d5d0a5..f1496b7 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -495,8 +495,7 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type, rcu_read_lock(); if (!ns) ns = task_active_pid_ns(current); - if (likely(pid_alive(task))) - nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns); + nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns); rcu_read_unlock(); return nr;