Skip to content

Commit 36a7411

Browse files
author
Al Viro
committed
eventfd_ctx_fdget(): use fdget() instead of fget()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1c1c874 commit 36a7411

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎fs/eventfd.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,12 @@ EXPORT_SYMBOL_GPL(eventfd_fget);
349349
*/
350350
struct eventfd_ctx *eventfd_ctx_fdget(int fd)
351351
{
352-
struct file *file;
353352
struct eventfd_ctx *ctx;
354-
355-
file = eventfd_fget(fd);
356-
if (IS_ERR(file))
357-
return (struct eventfd_ctx *) file;
358-
ctx = eventfd_ctx_get(file->private_data);
359-
fput(file);
360-
353+
struct fd f = fdget(fd);
354+
if (!f.file)
355+
return ERR_PTR(-EBADF);
356+
ctx = eventfd_ctx_fileget(f.file);
357+
fdput(f);
361358
return ctx;
362359
}
363360
EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);

0 commit comments

Comments
 (0)