diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-09 15:32:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-09 15:32:44 -0400 |
commit | 183c948a3cb3efbf45eabed41fa7ee04c19378fc (patch) | |
tree | 00f4cc777b7ba96d72666208a3c454fa26a33758 | |
parent | ffb927d1dce051f2c93d4510e446589189c1bf27 (diff) | |
parent | 5e00bbfbc5ec21e87d24e206bba9fc2cbe6631a1 (diff) |
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
-rw-r--r-- | drivers/tty/tty_io.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 8d26ed79bb4c..9b04d72e752e 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -2049,14 +2049,13 @@ static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode, | |||
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: | |||
2158 | read_lock(&tasklist_lock); | 2157 | read_lock(&tasklist_lock); |
2159 | spin_lock_irq(¤t->sighand->siglock); | 2158 | spin_lock_irq(¤t->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); |