diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-14 23:36:04 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-14 23:36:04 +0100 |
commit | 249f3c4fe4fdef159d3f9b3f7a6c41a92103c860 (patch) | |
tree | 58abfec8444741fd3bd403a908be50c4f63d4842 /drivers/tty/tty_mutex.c | |
parent | xen/hvc: constify hv_ops structures (diff) | |
parent | Linux 4.5-rc4 (diff) | |
download | linux-249f3c4fe4fdef159d3f9b3f7a6c41a92103c860.tar.xz linux-249f3c4fe4fdef159d3f9b3f7a6c41a92103c860.zip |
Merge 4.5-rc4 into tty-next
We want the fixes in here, and this resolves a merge error in tty_io.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/tty_mutex.c')
-rw-r--r-- | drivers/tty/tty_mutex.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/tty/tty_mutex.c b/drivers/tty/tty_mutex.c index 75351e4b77df..d8bae67a6174 100644 --- a/drivers/tty/tty_mutex.c +++ b/drivers/tty/tty_mutex.c @@ -21,10 +21,15 @@ EXPORT_SYMBOL(tty_lock); int tty_lock_interruptible(struct tty_struct *tty) { + int ret; + if (WARN(tty->magic != TTY_MAGIC, "L Bad %p\n", tty)) return -EIO; tty_kref_get(tty); - return mutex_lock_interruptible(&tty->legacy_mutex); + ret = mutex_lock_interruptible(&tty->legacy_mutex); + if (ret) + tty_kref_put(tty); + return ret; } void tty_unlock(struct tty_struct *tty) |