summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-12-24 01:51:33 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-01-25 12:13:04 +0400
commit36a7411724b1caf2fa92b5e4a41576ee8f16769e (patch)
treec31f54f03d05b26e28e1a01a2ed0003a319b2c10 /fs
parent1c1c8747cd0528fe1d225badf25bf5346d799ea3 (diff)
downloadlinux-36a7411724b1caf2fa92b5e4a41576ee8f16769e.tar.xz
eventfd_ctx_fdget(): use fdget() instead of fget()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/eventfd.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/eventfd.c b/fs/eventfd.c
index 35470d9b96e6..d6a88e7812f3 100644
--- a/fs/eventfd.c
+++ b/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);