Signed-off-by: Jonathan Corbet <corbet@lwn.net>
DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
DBG(KERN_INFO "%s: tun_chr_fasync %d\n", tun->dev->name, on);
if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
if ((ret = fasync_helper(fd, file, on, &tun->fasync)) < 0)
if (on) {
ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0);
if (ret)
if (on) {
ret = __f_setown(file, task_pid(current), PIDTYPE_PID, 0);
if (ret)
tun->flags |= TUN_FASYNC;
} else
tun->flags &= ~TUN_FASYNC;
tun->flags |= TUN_FASYNC;
} else
tun->flags &= ~TUN_FASYNC;
+ ret = 0;
+out:
+ unlock_kernel();
+ return ret;
}
static int tun_chr_open(struct inode *inode, struct file * file)
}
static int tun_chr_open(struct inode *inode, struct file * file)