tty: Redo current tty locking

Currently it is sometimes locked by the tty mutex and sometimes by the
sighand lock. The latter is in fact correct and now we can hand back referenced
objects we can fix this up without problems around sleeping functions.

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Alan Cox 2008-10-13 10:40:43 +01:00 • committed by Linus Torvalds
commit 934e6ebf96
4 changed files with 5 additions and 18 deletions

View file

@ -431,6 +431,7 @@ fs3270_open(struct inode *inode, struct file *filp)
tty = get_current_tty();
if (!tty || tty->driver->major != IBM_TTY3270_MAJOR) {
tty_kref_put(tty);
mutex_unlock(&tty_mutex);
rc = -ENODEV;
goto out;
}