mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
switch signalfd4() to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
545ec2c794
commit
20ba5d736f
1 changed files with 4 additions and 3 deletions
|
@ -269,12 +269,13 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
|
||||||
if (ufd < 0)
|
if (ufd < 0)
|
||||||
kfree(ctx);
|
kfree(ctx);
|
||||||
} else {
|
} else {
|
||||||
struct file *file = fget(ufd);
|
int fput_needed;
|
||||||
|
struct file *file = fget_light(ufd, &fput_needed);
|
||||||
if (!file)
|
if (!file)
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
ctx = file->private_data;
|
ctx = file->private_data;
|
||||||
if (file->f_op != &signalfd_fops) {
|
if (file->f_op != &signalfd_fops) {
|
||||||
fput(file);
|
fput_light(file, fput_needed);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
spin_lock_irq(¤t->sighand->siglock);
|
spin_lock_irq(¤t->sighand->siglock);
|
||||||
|
@ -282,7 +283,7 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
|
||||||
spin_unlock_irq(¤t->sighand->siglock);
|
spin_unlock_irq(¤t->sighand->siglock);
|
||||||
|
|
||||||
wake_up(¤t->sighand->signalfd_wqh);
|
wake_up(¤t->sighand->signalfd_wqh);
|
||||||
fput(file);
|
fput_light(file, fput_needed);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ufd;
|
return ufd;
|
||||||
|
|
Loading…
Add table
Reference in a new issue