pty: Don't drop pty master tty lock to hangup slave
authorPeter Hurley <peter@hurleysoftware.com>
Wed, 5 Nov 2014 17:13:04 +0000 (12:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Nov 2014 02:50:42 +0000 (18:50 -0800)
With the revised tty lock order and lockdep annotation, claiming
the pty slave lock is now safe while still holding the pty master lock.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c

index 11db7dc8676b6d493cbf1acfd35039a730f8205b..bee9776730fd76ae2ddf2d9650d8f55441d0d8c5 100644 (file)
@@ -66,9 +66,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
                        mutex_unlock(&devpts_mutex);
                }
 #endif
-               tty_unlock(tty);
                tty_vhangup(tty->link);
-               tty_lock(tty);
        }
 }