]> err.no Git - linux-2.6/blobdiff - fs/proc/array.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / fs / proc / array.c
index 07d6c4853fe858da49c51d8c199a8a3ff635602a..dca997a93bff32295fd3af13737d17cd24da9d7b 100644 (file)
@@ -73,6 +73,7 @@
 #include <linux/signal.h>
 #include <linux/highmem.h>
 #include <linux/file.h>
+#include <linux/fdtable.h>
 #include <linux/times.h>
 #include <linux/cpuset.h>
 #include <linux/rcupdate.h>
@@ -425,12 +426,13 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
        cutime = cstime = utime = stime = cputime_zero;
        cgtime = gtime = cputime_zero;
 
-       rcu_read_lock();
        if (lock_task_sighand(task, &flags)) {
                struct signal_struct *sig = task->signal;
 
                if (sig->tty) {
-                       tty_pgrp = pid_nr_ns(sig->tty->pgrp, ns);
+                       struct pid *pgrp = tty_get_pgrp(sig->tty);
+                       tty_pgrp = pid_nr_ns(pgrp, ns);
+                       put_pid(pgrp);
                        tty_nr = new_encode_dev(tty_devnum(sig->tty));
                }
 
@@ -469,7 +471,6 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
 
                unlock_task_sighand(task, &flags);
        }
-       rcu_read_unlock();
 
        if (!whole || num_threads < 2)
                wchan = get_wchan(task);