Skip to content

Commit 1dd694a

Browse files
oleg-nesterovebiederm
authored andcommitted
remove the no longer needed pid_alive() check in __task_pid_nr_ns()
Starting from 2c47047 ("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 <oleg@redhat.com> Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
1 parent 06576ed commit 1dd694a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

kernel/pid.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,7 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
495495
rcu_read_lock();
496496
if (!ns)
497497
ns = task_active_pid_ns(current);
498-
if (likely(pid_alive(task)))
499-
nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
498+
nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
500499
rcu_read_unlock();
501500

502501
return nr;

0 commit comments

Comments
 (0)