Skip to content

Commit

Permalink
tun: fasync BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jul 2, 2008
1 parent 743115e commit 9d31952
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9d31952

Please sign in to comment.