Commit 20ba5d736f5a42abbee3e14384ff2d0fdaef2e6d
1 parent
545ec2c794
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
switch signalfd4() to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff
fs/signalfd.c
... | ... | @@ -269,12 +269,13 @@ |
269 | 269 | if (ufd < 0) |
270 | 270 | kfree(ctx); |
271 | 271 | } else { |
272 | - struct file *file = fget(ufd); | |
272 | + int fput_needed; | |
273 | + struct file *file = fget_light(ufd, &fput_needed); | |
273 | 274 | if (!file) |
274 | 275 | return -EBADF; |
275 | 276 | ctx = file->private_data; |
276 | 277 | if (file->f_op != &signalfd_fops) { |
277 | - fput(file); | |
278 | + fput_light(file, fput_needed); | |
278 | 279 | return -EINVAL; |
279 | 280 | } |
280 | 281 | spin_lock_irq(¤t->sighand->siglock); |
... | ... | @@ -282,7 +283,7 @@ |
282 | 283 | spin_unlock_irq(¤t->sighand->siglock); |
283 | 284 | |
284 | 285 | wake_up(¤t->sighand->signalfd_wqh); |
285 | - fput(file); | |
286 | + fput_light(file, fput_needed); | |
286 | 287 | } |
287 | 288 | |
288 | 289 | return ufd; |