diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-06-19 22:04:53 (GMT) |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-07-02 21:06:27 (GMT) |
commit | 5d1e3230f4b4a93c6561b0fb5a99bb1eb02227ed (patch) | |
tree | 4578280231f68633111c352b3a265bfa152c146a /drivers/char | |
parent | 9d319522576ce0b2fd023a965445f9c3739ee6f1 (diff) | |
download | linux-5d1e3230f4b4a93c6561b0fb5a99bb1eb02227ed.tar.xz |
tty_io: fasync BKL pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_io.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index fd182f2..eda2789 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -2909,15 +2909,16 @@ static int tty_fasync(int fd, struct file *filp, int on) { struct tty_struct *tty; unsigned long flags; - int retval; + int retval = 0; + lock_kernel(); tty = (struct tty_struct *)filp->private_data; if (tty_paranoia_check(tty, filp->f_path.dentry->d_inode, "tty_fasync")) - return 0; + goto out; retval = fasync_helper(fd, filp, on, &tty->fasync); if (retval <= 0) - return retval; + goto out; if (on) { enum pid_type type; @@ -2935,12 +2936,15 @@ static int tty_fasync(int fd, struct file *filp, int on) spin_unlock_irqrestore(&tty->ctrl_lock, flags); retval = __f_setown(filp, pid, type, 0); if (retval) - return retval; + goto out; } else { if (!tty->fasync && !waitqueue_active(&tty->read_wait)) tty->minimum_to_wake = N_TTY_BUF_SIZE; } - return 0; + retval = 0; +out: + unlock_kernel(); + return retval; } /** |