diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 613c852ee0fe..615ecf37e284 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -1304,7 +1304,8 @@ static int tty_reopen(struct tty_struct *tty) { struct tty_driver *driver = tty->driver; - if (test_bit(TTY_CLOSING, &tty->flags)) + if (test_bit(TTY_CLOSING, &tty->flags) || + test_bit(TTY_LDISC_CHANGING, &tty->flags)) return -EIO; if (driver->type == TTY_DRIVER_TYPE_PTY &&