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
20492049 if (tty) {
20502050 mutex_unlock(&tty_mutex);
20512051 retval = tty_lock_interruptible(tty);
2052+ tty_kref_put(tty); /* drop kref from tty_driver_lookup_tty() */
20522053 if (retval) {
20532054 if (retval == -EINTR)
20542055 retval = -ERESTARTSYS;
20552056 tty = ERR_PTR(retval);
20562057 goto out;
20572058 }
2058− /* safe to drop the kref from tty_driver_lookup_tty() */
2059− tty_kref_put(tty);
20602059 retval = tty_reopen(tty);
20612060 if (retval < 0) {
20622061 tty_unlock(tty);
@@ -2158,7 +2157,7 @@ retry_open: · 95 unmodified lines
21582157 read_lock(&tasklist_lock);
21592158 spin_lock_irq(&current->sighand->siglock);
21602159 noctty = (filp->f_flags & O_NOCTTY) ||
2161− device == MKDEV(TTY_MAJOR, 0) ||
2160+ (IS_ENABLED(CONFIG_VT) && device == MKDEV(TTY_MAJOR, 0)) ||
21622161 device == MKDEV(TTYAUX_MAJOR, 1) ||
21632162 (tty->driver->type == TTY_DRIVER_TYPE_PTY &&
21642163 tty->driver->subtype == PTY_TYPE_MASTER);