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

@@@ -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
@@@ -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;