From: Greg Kroah-Hartman Date: Fri, 24 Feb 2012 21:56:36 +0000 (-0800) Subject: Revert "TTY: pty, remove superfluous ptm test" X-Git-Tag: v3.4-rc1~185^2~104 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=ce1000ddca01c81684da844be4676eac50a70c2a;p=linux-block.git Revert "TTY: pty, remove superfluous ptm test" This reverts commit a50f724a432997321cabb6c9e665c28e34850f78. Sasha reported that this causes problems, so revert it. Cc: Alan Cox Cc: Jiri Slaby Cc: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index ddec9f3c3396..d505837b3478 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -54,7 +54,10 @@ static void pty_close(struct tty_struct *tty, struct file *filp) wake_up_interruptible(&tty->link->write_wait); if (tty->driver->subtype == PTY_TYPE_MASTER) { set_bit(TTY_OTHER_CLOSED, &tty->flags); - devpts_pty_kill(tty->link); +#ifdef CONFIG_UNIX98_PTYS + if (tty->driver == ptm_driver) + devpts_pty_kill(tty->link); +#endif tty_unlock(); tty_vhangup(tty->link); tty_lock();