Merge 4.5-rc4 into tty-next
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Feb 2016 22:36:04 +0000 (14:36 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Feb 2016 22:36:04 +0000 (14:36 -0800)
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>
1  2 
drivers/tty/pty.c
drivers/tty/serial/8250/8250_pci.c
drivers/tty/serial/omap-serial.c
drivers/tty/tty_mutex.c

index 78170e7aa3a31acd8c2bb1592bb2064775215b8b,2348fa6137070e19c19d97a5dc436b1a0b762441..e16a49b507efbd57734b0b8f522d0e2a5dfe03ce
@@@ -660,10 -674,21 +660,17 @@@ static int pty_unix98_install(struct tt
        return pty_common_install(driver, tty, false);
  }
  
 -static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
 -{
 -}
 -
  /* this is called once with whichever end is closed last */
 -static void pty_unix98_shutdown(struct tty_struct *tty)
 +static void pty_unix98_remove(struct tty_driver *driver, struct tty_struct *tty)
  {
-       devpts_kill_index(tty->driver_data, tty->index);
+       struct inode *ptmx_inode;
+       if (tty->driver->subtype == PTY_TYPE_MASTER)
+               ptmx_inode = tty->driver_data;
+       else
+               ptmx_inode = tty->link->driver_data;
+       devpts_kill_index(ptmx_inode, tty->index);
+       devpts_del_ref(ptmx_inode);
  }
  
  static const struct tty_operations ptm_unix98_ops = {
Simple merge
Simple merge
index 75351e4b77dfbad2843cb96331b1bcdfa4af4672,dfa9ec03fa8e06dfe03a6e0ae04c62a2ac774103..d8bae67a6174b65e676a887e08dd9e681c2f5693
@@@ -24,10 -26,13 +26,13 @@@ int tty_lock_interruptible(struct tty_s
        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 __lockfunc tty_unlock(struct tty_struct *tty)
 +void tty_unlock(struct tty_struct *tty)
  {
        if (WARN(tty->magic != TTY_MAGIC, "U Bad %p\n", tty))
                return;