wake_up_interruptible(&tty->link->write_wait);
if (tty->driver->subtype == PTY_TYPE_MASTER) {
set_bit(TTY_OTHER_CLOSED, &tty->flags);
- devpts_pty_kill(tty->link);
tty_unlock();
+ devpts_pty_kill(tty->link);
tty_vhangup(tty->link);
tty_lock();
}
return retval;
/* find a device that is not in use. */
- tty_lock();
index = devpts_new_index(inode);
- tty_unlock();
if (index < 0) {
retval = index;
goto err_file;
tty_release(inode, filp);
return retval;
out:
- devpts_kill_index(inode, index);
tty_unlock();
+ devpts_kill_index(inode, index);
err_file:
tty_free_file(filp);
return retval;
* the slots and preserving the termios structure.
*/
release_tty(tty, idx);
+ tty_unlock();
/* Make this pty number available for reallocation */
if (devpts)
devpts_kill_index(inode, idx);
- tty_unlock();
return 0;
}