summaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 05:05:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-30 05:05:54 -0700
commit720d690e3680d8ae5fcf86f8614c1a10b4ee7605 (patch)
tree02158973d51022d7374f5b6e2f1953b530127f43 /drivers/tty/tty_io.c
parent72b6500c1cc68b949faa1bac76359dc601b482d6 (diff)
parent6da6c0db5316275015e8cc2959f12a17584aeb64 (diff)
downloadlinux-720d690e3680d8ae5fcf86f8614c1a10b4ee7605.tar.bz2
Merge 4.17-rc3 into char-misc-next
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 63114ea35ec1..7c838b90a31d 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -2816,7 +2816,10 @@ struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx)
kref_init(&tty->kref);
tty->magic = TTY_MAGIC;
- tty_ldisc_init(tty);
+ if (tty_ldisc_init(tty)) {
+ kfree(tty);
+ return NULL;
+ }
tty->session = NULL;
tty->pgrp = NULL;
mutex_init(&tty->legacy_mutex);