eventfd_ctx_fdget(): use fdget() instead of fget()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 23 Dec 2013 21:51:33 +0000 (16:51 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 25 Jan 2014 08:13:04 +0000 (03:13 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/eventfd.c

index 35470d9..d6a88e7 100644 (file)
@@ -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);