aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/tty_io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 32bc3e3fe4d3..5e5da9acaf0a 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1255,6 +1255,7 @@ static void tty_driver_remove_tty(struct tty_driver *driver, struct tty_struct *
1255static int tty_reopen(struct tty_struct *tty) 1255static int tty_reopen(struct tty_struct *tty)
1256{ 1256{
1257 struct tty_driver *driver = tty->driver; 1257 struct tty_driver *driver = tty->driver;
1258 int retval;
1258 1259
1259 if (driver->type == TTY_DRIVER_TYPE_PTY && 1260 if (driver->type == TTY_DRIVER_TYPE_PTY &&
1260 driver->subtype == PTY_TYPE_MASTER) 1261 driver->subtype == PTY_TYPE_MASTER)
@@ -1268,10 +1269,14 @@ static int tty_reopen(struct tty_struct *tty)
1268 1269
1269 tty->count++; 1270 tty->count++;
1270 1271
1271 if (!tty->ldisc) 1272 if (tty->ldisc)
1272 return tty_ldisc_reinit(tty, tty->termios.c_line); 1273 return 0;
1273 1274
1274 return 0; 1275 retval = tty_ldisc_reinit(tty, tty->termios.c_line);
1276 if (retval)
1277 tty->count--;
1278
1279 return retval;
1275} 1280}
1276 1281
1277/** 1282/**