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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 07d6c4853fe8..dca997a93bff 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -73,6 +73,7 @@
73#include <linux/signal.h> 73#include <linux/signal.h>
74#include <linux/highmem.h> 74#include <linux/highmem.h>
75#include <linux/file.h> 75#include <linux/file.h>
76#include <linux/fdtable.h>
76#include <linux/times.h> 77#include <linux/times.h>
77#include <linux/cpuset.h> 78#include <linux/cpuset.h>
78#include <linux/rcupdate.h> 79#include <linux/rcupdate.h>
@@ -425,12 +426,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
425 cutime = cstime = utime = stime = cputime_zero; 426 cutime = cstime = utime = stime = cputime_zero;
426 cgtime = gtime = cputime_zero; 427 cgtime = gtime = cputime_zero;
427 428
428 rcu_read_lock();
429 if (lock_task_sighand(task, &flags)) { 429 if (lock_task_sighand(task, &flags)) {
430 struct signal_struct *sig = task->signal; 430 struct signal_struct *sig = task->signal;
431 431
432 if (sig->tty) { 432 if (sig->tty) {
433 tty_pgrp = pid_nr_ns(sig->tty->pgrp, ns); 433 struct pid *pgrp = tty_get_pgrp(sig->tty);
434 tty_pgrp = pid_nr_ns(pgrp, ns);
435 put_pid(pgrp);
434 tty_nr = new_encode_dev(tty_devnum(sig->tty)); 436 tty_nr = new_encode_dev(tty_devnum(sig->tty));
435 } 437 }
436 438
@@ -469,7 +471,6 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
469 471
470 unlock_task_sighand(task, &flags); 472 unlock_task_sighand(task, &flags);
471 } 473 }
472 rcu_read_unlock();
473 474
474 if (!whole || num_threads < 2) 475 if (!whole || num_threads < 2)
475 wchan = get_wchan(task); 476 wchan = get_wchan(task);