aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-06-19 15:50:37 -0600
committerJonathan Corbet <corbet@lwn.net>2008-07-02 15:06:27 -0600
commit9d319522576ce0b2fd023a965445f9c3739ee6f1 (patch)
treec4e2f1634d5f54a4ee3a77adf62cb2556169c239 /drivers/net/tun.c
parenti2o: fasync BKL pushdown (diff)
downloadlinux-dev-9d319522576ce0b2fd023a965445f9c3739ee6f1.tar.xz
linux-dev-9d319522576ce0b2fd023a965445f9c3739ee6f1.zip
tun: fasync BKL pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index ce5af2aa8843..4c0c5972a489 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -782,18 +782,21 @@ static int tun_chr_fasync(int fd, struct file *file, int on)
DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
+ lock_kernel();
if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
- return ret;
+ goto out;
if (on) {
ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0);
if (ret)
- return ret;
+ goto out;
tun->flags |= TUN_FASYNC;
} else
tun->flags &= ~TUN_FASYNC;
-
- return 0;
+ ret = 0;
+out:
+ unlock_kernel();
+ return ret;
}
static int tun_chr_open(struct inode *inode, struct file * file)