aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 16:55:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 16:55:54 -0500
commit0ef1698e4d6282a1665207c40b115ec78fceda9b (patch)
tree61df100f821a49b04bd4b2914fcb9998ee88e37c /drivers/tty
parent6dc01aa65306fe46b7ba38db51fad4ed81c23d00 (diff)
Revert "TTY: get rid of BTM around devpts_*"
This reverts commit d3bda5298aad98c7a27678bdd0dd9d008ab9e685. Sasha reported that this causes problems, so revert it. Cc: Sasha Levin <levinsasha928@gmail.com> Cc: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/pty.c6
-rw-r--r--drivers/tty/tty_io.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 39afd045f8ef..ddec9f3c3396 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -54,8 +54,8 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
54 wake_up_interruptible(&tty->link->write_wait); 54 wake_up_interruptible(&tty->link->write_wait);
55 if (tty->driver->subtype == PTY_TYPE_MASTER) { 55 if (tty->driver->subtype == PTY_TYPE_MASTER) {
56 set_bit(TTY_OTHER_CLOSED, &tty->flags); 56 set_bit(TTY_OTHER_CLOSED, &tty->flags);
57 tty_unlock();
58 devpts_pty_kill(tty->link); 57 devpts_pty_kill(tty->link);
58 tty_unlock();
59 tty_vhangup(tty->link); 59 tty_vhangup(tty->link);
60 tty_lock(); 60 tty_lock();
61 } 61 }
@@ -613,7 +613,9 @@ static int ptmx_open(struct inode *inode, struct file *filp)
613 return retval; 613 return retval;
614 614
615 /* find a device that is not in use. */ 615 /* find a device that is not in use. */
616 tty_lock();
616 index = devpts_new_index(inode); 617 index = devpts_new_index(inode);
618 tty_unlock();
617 if (index < 0) { 619 if (index < 0) {
618 retval = index; 620 retval = index;
619 goto err_file; 621 goto err_file;
@@ -648,8 +650,8 @@ err_release:
648 tty_release(inode, filp); 650 tty_release(inode, filp);
649 return retval; 651 return retval;
650out: 652out:
651 tty_unlock();
652 devpts_kill_index(inode, index); 653 devpts_kill_index(inode, index);
654 tty_unlock();
653err_file: 655err_file:
654 tty_free_file(filp); 656 tty_free_file(filp);
655 return retval; 657 return retval;
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index ea7ebe22a16c..44736f9e61d7 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1789,11 +1789,11 @@ int tty_release(struct inode *inode, struct file *filp)
1789 * the slots and preserving the termios structure. 1789 * the slots and preserving the termios structure.
1790 */ 1790 */
1791 release_tty(tty, idx); 1791 release_tty(tty, idx);
1792 tty_unlock();
1793 1792
1794 /* Make this pty number available for reallocation */ 1793 /* Make this pty number available for reallocation */
1795 if (devpts) 1794 if (devpts)
1796 devpts_kill_index(inode, idx); 1795 devpts_kill_index(inode, idx);
1796 tty_unlock();
1797 return 0; 1797 return 0;
1798} 1798}
1799 1799