aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 800e30f8f284..bd117d065b82 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -157,19 +157,18 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
157 struct user_namespace *user_ns = seq_user_ns(m); 157 struct user_namespace *user_ns = seq_user_ns(m);
158 struct group_info *group_info; 158 struct group_info *group_info;
159 int g; 159 int g;
160 struct task_struct *tracer;
160 const struct cred *cred; 161 const struct cred *cred;
161 pid_t ppid, tpid, tgid, ngid; 162 pid_t ppid, tpid = 0, tgid, ngid;
162 unsigned int max_fds = 0; 163 unsigned int max_fds = 0;
163 164
164 rcu_read_lock(); 165 rcu_read_lock();
165 ppid = pid_alive(p) ? 166 ppid = pid_alive(p) ?
166 task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0; 167 task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
167 tpid = 0; 168
168 if (pid_alive(p)) { 169 tracer = ptrace_parent(p);
169 struct task_struct *tracer = ptrace_parent(p); 170 if (tracer)
170 if (tracer) 171 tpid = task_pid_nr_ns(tracer, ns);
171 tpid = task_pid_nr_ns(tracer, ns);
172 }
173 172
174 tgid = task_tgid_nr_ns(p, ns); 173 tgid = task_tgid_nr_ns(p, ns);
175 ngid = task_numa_group_id(p); 174 ngid = task_numa_group_id(p);