diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-21 18:44:12 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:30 -0400 |
commit | 20ba5d736f5a42abbee3e14384ff2d0fdaef2e6d (patch) | |
tree | 7537c1a7c2efd3e145f52a43958c45581b0f4530 /fs/signalfd.c | |
parent | 545ec2c7945bf7d22d0779e7dc9bf16f7dd9ae34 (diff) |
switch signalfd4() to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/signalfd.c')
-rw-r--r-- | fs/signalfd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c index 7ae2a574cb25..9f35a37173de 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -269,12 +269,13 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, | |||
269 | if (ufd < 0) | 269 | if (ufd < 0) |
270 | kfree(ctx); | 270 | kfree(ctx); |
271 | } else { | 271 | } else { |
272 | struct file *file = fget(ufd); | 272 | int fput_needed; |
273 | struct file *file = fget_light(ufd, &fput_needed); | ||
273 | if (!file) | 274 | if (!file) |
274 | return -EBADF; | 275 | return -EBADF; |
275 | ctx = file->private_data; | 276 | ctx = file->private_data; |
276 | if (file->f_op != &signalfd_fops) { | 277 | if (file->f_op != &signalfd_fops) { |
277 | fput(file); | 278 | fput_light(file, fput_needed); |
278 | return -EINVAL; | 279 | return -EINVAL; |
279 | } | 280 | } |
280 | spin_lock_irq(¤t->sighand->siglock); | 281 | spin_lock_irq(¤t->sighand->siglock); |
@@ -282,7 +283,7 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, | |||
282 | spin_unlock_irq(¤t->sighand->siglock); | 283 | spin_unlock_irq(¤t->sighand->siglock); |
283 | 284 | ||
284 | wake_up(¤t->sighand->signalfd_wqh); | 285 | wake_up(¤t->sighand->signalfd_wqh); |
285 | fput(file); | 286 | fput_light(file, fput_needed); |
286 | } | 287 | } |
287 | 288 | ||
288 | return ufd; | 289 | return ufd; |