Commit 8e1f412b authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: fix spurious fput in registered ring path



Fix an issue with io_uring_ctx_get_file() not gating fput() on whether
or not the file descriptor is a registered/direct one or not.

Fixes: c5e9f6a9 ("io_uring: unify getting ctx from passed in file descriptor")
Reviewed-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 42a702aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2575,6 +2575,7 @@ struct file *io_uring_ctx_get_file(unsigned int fd, bool registered)
		return ERR_PTR(-EBADF);
	if (io_is_uring_fops(file))
		return file;
	if (!registered)
		fput(file);
	return ERR_PTR(-EOPNOTSUPP);
}