diff options
Diffstat (limited to 'fs/signalfd.c')
-rw-r--r-- | fs/signalfd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/signalfd.c b/fs/signalfd.c index 9f35a37173de..8bee4e570911 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -269,13 +269,12 @@ 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 | int fput_needed; | 272 | struct fd f = fdget(ufd); |
273 | struct file *file = fget_light(ufd, &fput_needed); | 273 | if (!f.file) |
274 | if (!file) | ||
275 | return -EBADF; | 274 | return -EBADF; |
276 | ctx = file->private_data; | 275 | ctx = f.file->private_data; |
277 | if (file->f_op != &signalfd_fops) { | 276 | if (f.file->f_op != &signalfd_fops) { |
278 | fput_light(file, fput_needed); | 277 | fdput(f); |
279 | return -EINVAL; | 278 | return -EINVAL; |
280 | } | 279 | } |
281 | spin_lock_irq(¤t->sighand->siglock); | 280 | spin_lock_irq(¤t->sighand->siglock); |
@@ -283,7 +282,7 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask, | |||
283 | spin_unlock_irq(¤t->sighand->siglock); | 282 | spin_unlock_irq(¤t->sighand->siglock); |
284 | 283 | ||
285 | wake_up(¤t->sighand->signalfd_wqh); | 284 | wake_up(¤t->sighand->signalfd_wqh); |
286 | fput_light(file, fput_needed); | 285 | fdput(f); |
287 | } | 286 | } |
288 | 287 | ||
289 | return ufd; | 288 | return ufd; |