Merge tag 'tty-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty fixes from Greg KH: "Here are two tty fixes for issues found. One was due to a merge error in 4.6-rc1, and the other a regression fix for UML consoles that broke in 4.6-rc1. Both have been in linux-next for a while" * tag 'tty-4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: Fix merge of "tty: Refactor tty_open()" tty: Fix UML console breakage
This commit is contained in:
@@ -2049,14 +2049,13 @@ static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode,
|
|||||||
if (tty) {
|
if (tty) {
|
||||||
mutex_unlock(&tty_mutex);
|
mutex_unlock(&tty_mutex);
|
||||||
retval = tty_lock_interruptible(tty);
|
retval = tty_lock_interruptible(tty);
|
||||||
|
tty_kref_put(tty); /* drop kref from tty_driver_lookup_tty() */
|
||||||
if (retval) {
|
if (retval) {
|
||||||
if (retval == -EINTR)
|
if (retval == -EINTR)
|
||||||
retval = -ERESTARTSYS;
|
retval = -ERESTARTSYS;
|
||||||
tty = ERR_PTR(retval);
|
tty = ERR_PTR(retval);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
/* safe to drop the kref from tty_driver_lookup_tty() */
|
|
||||||
tty_kref_put(tty);
|
|
||||||
retval = tty_reopen(tty);
|
retval = tty_reopen(tty);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
tty_unlock(tty);
|
tty_unlock(tty);
|
||||||
@@ -2158,7 +2157,7 @@ retry_open:
|
|||||||
read_lock(&tasklist_lock);
|
read_lock(&tasklist_lock);
|
||||||
spin_lock_irq(¤t->sighand->siglock);
|
spin_lock_irq(¤t->sighand->siglock);
|
||||||
noctty = (filp->f_flags & O_NOCTTY) ||
|
noctty = (filp->f_flags & O_NOCTTY) ||
|
||||||
device == MKDEV(TTY_MAJOR, 0) ||
|
(IS_ENABLED(CONFIG_VT) && device == MKDEV(TTY_MAJOR, 0)) ||
|
||||||
device == MKDEV(TTYAUX_MAJOR, 1) ||
|
device == MKDEV(TTYAUX_MAJOR, 1) ||
|
||||||
(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
|
(tty->driver->type == TTY_DRIVER_TYPE_PTY &&
|
||||||
tty->driver->subtype == PTY_TYPE_MASTER);
|
tty->driver->subtype == PTY_TYPE_MASTER);
|
||||||
|
|||||||
Reference in New Issue
Block a user