aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-03-19 14:11:12 +0200
committerAvi Kivity <avi@qumranet.com>2007-03-19 14:11:12 +0200
commit7b99ea3b210c8433102c98eb390c7c776360fe3d (patch)
tree343ae6ce2c51ad6f08559c45a12add04b6e66991 /drivers/char/tty_io.c
parent128e159e11e999496ec44a549fcac91de3802389 (diff)
parent5851fadce8824d5d4b8fd02c22ae098401f6489e (diff)
Merge branch 'origin'kvm-17
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index e45326856680..7a32df594907 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1376,6 +1376,8 @@ static void do_tty_hangup(struct work_struct *work)
read_unlock(&tasklist_lock);
tty->flags = 0;
+ put_pid(tty->session);
+ put_pid(tty->pgrp);
tty->session = NULL;
tty->pgrp = NULL;
tty->ctrl_status = 0;
@@ -3841,6 +3843,9 @@ static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tt
{
struct pid *old_pgrp;
if (tty) {
+ /* We should not have a session or pgrp to here but.... */
+ put_pid(tty->session);
+ put_pid(tty->pgrp);
tty->session = get_pid(task_session(tsk));
tty->pgrp = get_pid(task_pgrp(tsk));
}