aboutsummaryrefslogtreecommitdiff
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorSuraj Das <surajdazz@gmail.com>2017-06-25 19:07:06 +0530
committerSuraj Das <surajdazz@gmail.com>2017-06-25 19:15:40 +0530
commit6e033ebda94e620277a569625745cf21c749efdb (patch)
tree641e80dabecde9fd9108b654bf43828d78632509 /fs/proc/array.c
parentfa097959467283e96988ba548a20ccb3ec27c0c1 (diff)
parent262196005747d5e8b4106e92adae3749e8686240 (diff)
Merge branch 'cm-14.1' of https://github.com/LineageOS/android_kernel_oneplus_msm8974 into n7.1HEADn7.1
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index e7bb0fed720..607f80c8d50 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -166,16 +166,16 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
int g;
struct fdtable *fdt = NULL;
const struct cred *cred;
- pid_t ppid, tpid;
+ pid_t ppid = 0, tpid = 0;
+ struct task_struct *leader = NULL;
rcu_read_lock();
- ppid = pid_alive(p) ?
- task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
- tpid = 0;
if (pid_alive(p)) {
struct task_struct *tracer = ptrace_parent(p);
if (tracer)
tpid = task_pid_nr_ns(tracer, ns);
+ ppid = task_tgid_nr_ns(rcu_dereference(p->real_parent), ns);
+ leader = p->group_leader;
}
cred = get_task_cred(p);
seq_printf(m,
@@ -187,7 +187,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
"Uid:\t%d\t%d\t%d\t%d\n"
"Gid:\t%d\t%d\t%d\t%d\n",
get_task_state(p),
- task_tgid_nr_ns(p, ns),
+ leader ? task_pid_nr_ns(leader, ns) : 0,
pid_nr_ns(pid, ns),
ppid, tpid,
cred->uid, cred->euid, cred->suid, cred->fsuid,