From: Al Viro Date: Mon, 23 Dec 2013 21:51:33 +0000 (-0500) Subject: eventfd_ctx_fdget(): use fdget() instead of fget() X-Git-Tag: v3.14-rc1~78^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36a7411724b1caf2fa92b5e4a41576ee8f16769e;p=profile%2Fivi%2Fkernel-x86-ivi.git eventfd_ctx_fdget(): use fdget() instead of fget() Signed-off-by: Al Viro --- diff --git a/fs/eventfd.c b/fs/eventfd.c index 35470d9..d6a88e7 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);