diff --git a/drivers/char/tty_ldisc.c b/drivers/char/tty_ldisc.c index 7af1a1563e8f..236628f3fea1 100644 --- a/drivers/char/tty_ldisc.c +++ b/drivers/char/tty_ldisc.c @@ -452,6 +452,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld) /* BKL here locks verus a hangup event */ lock_kernel(); ret = ld->ops->open(tty); + if (ret) + clear_bit(TTY_LDISC_OPEN, &tty->flags); unlock_kernel(); return ret; }