History

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

Linus Torvalds committed 10 years ago

Commit 183c9482 parents ffb927d 5e00bbf1 file · +2 −3Browse files

Unified · Split

drivers/tty/tty_io.c+2−3
@@ -2049,14 +2049,13 @@ static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode, · 2048 unmodified lines
2049 if (tty) {2049 if (tty) {
2050 mutex_unlock(&tty_mutex);2050 mutex_unlock(&tty_mutex);
2051 retval = tty_lock_interruptible(tty);2051 retval = tty_lock_interruptible(tty);
2052 tty_kref_put(tty); /* drop kref from tty_driver_lookup_tty() */
2052 if (retval) {2053 if (retval) {
2053 if (retval == -EINTR)2054 if (retval == -EINTR)
2054 retval = -ERESTARTSYS;2055 retval = -ERESTARTSYS;
2055 tty = ERR_PTR(retval);2056 tty = ERR_PTR(retval);
2056 goto out;2057 goto out;
2057 }2058 }
2058 /* safe to drop the kref from tty_driver_lookup_tty() */
2059 tty_kref_put(tty);
2060 retval = tty_reopen(tty);2059 retval = tty_reopen(tty);
2061 if (retval < 0) {2060 if (retval < 0) {
2062 tty_unlock(tty);2061 tty_unlock(tty);
@@ -2158,7 +2157,7 @@ retry_open: · 95 unmodified lines
2158 read_lock(&tasklist_lock);2157 read_lock(&tasklist_lock);
2159 spin_lock_irq(&current->sighand->siglock);2158 spin_lock_irq(&current->sighand->siglock);
2160 noctty = (filp->f_flags & O_NOCTTY) ||2159 noctty = (filp->f_flags & O_NOCTTY) ||
2161 device == MKDEV(TTY_MAJOR, 0) ||2160 (IS_ENABLED(CONFIG_VT) && device == MKDEV(TTY_MAJOR, 0)) ||
2162 device == MKDEV(TTYAUX_MAJOR, 1) ||2161 device == MKDEV(TTYAUX_MAJOR, 1) ||
2163 (tty->driver->type == TTY_DRIVER_TYPE_PTY &&2162 (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
2164 tty->driver->subtype == PTY_TYPE_MASTER);2163 tty->driver->subtype == PTY_TYPE_MASTER);