Skip to content

Commit

Permalink
switch signalfd4() to fget_light/fput_light
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 30, 2012
1 parent 545ec2c commit 20ba5d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/signalfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,21 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
if (ufd < 0)
kfree(ctx);
} else {
struct file *file = fget(ufd);
int fput_needed;
struct file *file = fget_light(ufd, &fput_needed);
if (!file)
return -EBADF;
ctx = file->private_data;
if (file->f_op != &signalfd_fops) {
fput(file);
fput_light(file, fput_needed);
return -EINVAL;
}
spin_lock_irq(&current->sighand->siglock);
ctx->sigmask = sigmask;
spin_unlock_irq(&current->sighand->siglock);

wake_up(&current->sighand->signalfd_wqh);
fput(file);
fput_light(file, fput_needed);
}

return ufd;
Expand Down

0 comments on commit 20ba5d7

Please sign in to comment.