diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-10 12:42:04 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-10 12:42:04 +0900 |
commit | 394e849b83463869e2267ea7acea002366e6fefc (patch) | |
tree | 917ec5c564964d781ffbda2917efdf7cde252c72 /drivers/tty | |
parent | 98267d33e2da8cd386212856a22f4a64b32834ab (diff) | |
parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) | |
download | op-kernel-dev-394e849b83463869e2267ea7acea002366e6fefc.zip op-kernel-dev-394e849b83463869e2267ea7acea002366e6fefc.tar.gz |
Merge 3.18-rc4 into tty-next.
This resolves a merge issue with drivers/tty/serial/8250/8250_mtk.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_tty.c | 9 | ||||
-rw-r--r-- | drivers/tty/serial/of_serial.c | 2 | ||||
-rw-r--r-- | drivers/tty/vt/consolemap.c | 7 |
3 files changed, 15 insertions, 3 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 112eda7..8358daa 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c @@ -2406,12 +2406,17 @@ static unsigned int n_tty_poll(struct tty_struct *tty, struct file *file, poll_wait(file, &tty->read_wait, wait); poll_wait(file, &tty->write_wait, wait); + if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) + mask |= POLLHUP; if (input_available_p(tty, 1)) mask |= POLLIN | POLLRDNORM; + else if (mask & POLLHUP) { + tty_flush_to_ldisc(tty); + if (input_available_p(tty, 1)) + mask |= POLLIN | POLLRDNORM; + } if (tty->packet && tty->link->ctrl_status) mask |= POLLPRI | POLLIN | POLLRDNORM; - if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) - mask |= POLLHUP; if (tty_hung_up_p(file)) mask |= POLLHUP; if (!(mask & (POLLHUP | POLLIN | POLLRDNORM))) { diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 7bc1634..22f06a6 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -170,7 +170,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev) if (of_find_property(ofdev->dev.of_node, "used-by-rtas", NULL)) return -EBUSY; - info = kmalloc(sizeof(*info), GFP_KERNEL); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (info == NULL) return -ENOMEM; diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c index 610b720..59b25e0 100644 --- a/drivers/tty/vt/consolemap.c +++ b/drivers/tty/vt/consolemap.c @@ -539,6 +539,12 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) /* Save original vc_unipagdir_loc in case we allocate a new one */ p = *vc->vc_uni_pagedir_loc; + + if (!p) { + err = -EINVAL; + + goto out_unlock; + } if (p->refcount > 1) { int j, k; @@ -623,6 +629,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list) set_inverse_transl(vc, p, i); /* Update inverse translations */ set_inverse_trans_unicode(vc, p); +out_unlock: console_unlock(); return err; } |