Subject: [PATCH] pspace: Don't attempt to send signals from a tty if I don't have a process group or a pspace From: Eric W. Biederman Date: 1134672919 -0700 --- drivers/char/tty_io.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) 7ff8677fa8f08673a6fa1a80c49505f1f6c2889f diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 7a27461..8408417 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1712,17 +1712,21 @@ static void release_dev(struct file * fi struct task_struct *p; read_lock(&tasklist_lock); - do_each_task_pid(tty->pspace, tty->session, PIDTYPE_SID, p) { - p->signal->tty = NULL; - } while_each_task_pid(tty->pspace, tty->session, PIDTYPE_SID, p); + if (tty->pspace) { + do_each_task_pid(tty->pspace, tty->session, PIDTYPE_SID, p) { + p->signal->tty = NULL; + } while_each_task_pid(tty->pspace, tty->session, PIDTYPE_SID, p); + } put_pspace(tty->pspace); tty->pspace = NULL; tty->session = 0; tty->pgrp = -1; if (o_tty) { - do_each_task_pid(o_tty->pspace, o_tty->session, PIDTYPE_SID, p) { - p->signal->tty = NULL; - } while_each_task_pid(o_tty->pspace, o_tty->session, PIDTYPE_SID, p); + if (o_tty->pspace) { + do_each_task_pid(o_tty->pspace, o_tty->session, PIDTYPE_SID, p) { + p->signal->tty = NULL; + } while_each_task_pid(o_tty->pspace, o_tty->session, PIDTYPE_SID, p); + } put_pspace(o_tty->pspace); o_tty->pspace = NULL; o_tty->session = 0; -- 1.0.GIT