Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36a74117 authored by Al Viro's avatar Al Viro
Browse files

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



Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 1c1c8747
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -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);