BSD pty drivers are cross-linked at driver initialization and linked pairs
must have the same tty index; use this information to simplify clearing
the driver tables.

Signed-off-by: Peter Hurley <[email protected]>
---
 drivers/tty/pty.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index be5020d..2680044 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -463,10 +463,8 @@ static int pty_install(struct tty_driver *driver, struct 
tty_struct *tty)
 
 static void pty_remove(struct tty_driver *driver, struct tty_struct *tty)
 {
-       struct tty_struct *pair = tty->link;
        driver->ttys[tty->index] = NULL;
-       if (pair)
-               pair->driver->ttys[pair->index] = NULL;
+       driver->other->ttys[tty->index] = NULL;
 }
 
 static int pty_bsd_ioctl(struct tty_struct *tty,
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to