eventfd_ctx_fdget(): use fdget() instead of fget()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
13
fs/eventfd.c
13
fs/eventfd.c
@@ -349,15 +349,12 @@ EXPORT_SYMBOL_GPL(eventfd_fget);
|
|||||||
*/
|
*/
|
||||||
struct eventfd_ctx *eventfd_ctx_fdget(int fd)
|
struct eventfd_ctx *eventfd_ctx_fdget(int fd)
|
||||||
{
|
{
|
||||||
struct file *file;
|
|
||||||
struct eventfd_ctx *ctx;
|
struct eventfd_ctx *ctx;
|
||||||
|
struct fd f = fdget(fd);
|
||||||
file = eventfd_fget(fd);
|
if (!f.file)
|
||||||
if (IS_ERR(file))
|
return ERR_PTR(-EBADF);
|
||||||
return (struct eventfd_ctx *) file;
|
ctx = eventfd_ctx_fileget(f.file);
|
||||||
ctx = eventfd_ctx_get(file->private_data);
|
fdput(f);
|
||||||
fput(file);
|
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);
|
EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);
|
||||||
|
Reference in New Issue
Block a user