Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

eventfd_ctx_fdget(): use fdget() instead of fget()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information...
commit 36a7411724b1caf2fa92b5e4a41576ee8f16769e 1 parent 1c1c874
Al Viro authored
Showing with 5 additions and 8 deletions.
  1. +5 −8 fs/eventfd.c
View
13 fs/eventfd.c
@@ -349,15 +349,12 @@ EXPORT_SYMBOL_GPL(eventfd_fget);
*/
struct eventfd_ctx *eventfd_ctx_fdget(int fd)
{
- struct file *file;
struct eventfd_ctx *ctx;
-
- file = eventfd_fget(fd);
- if (IS_ERR(file))
- return (struct eventfd_ctx *) file;
- ctx = eventfd_ctx_get(file->private_data);
- fput(file);
-
+ struct fd f = fdget(fd);
+ if (!f.file)
+ return ERR_PTR(-EBADF);
+ ctx = eventfd_ctx_fileget(f.file);
+ fdput(f);
return ctx;
}
EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);
Please sign in to comment.
Something went wrong with that request. Please try again.