mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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: c5e9f6a96b ("io_uring: unify getting ctx from passed in file descriptor")
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
42a702aaed
commit
8e1f412b5b
|
|
@ -2575,7 +2575,8 @@ struct file *io_uring_ctx_get_file(unsigned int fd, bool registered)
|
|||
return ERR_PTR(-EBADF);
|
||||
if (io_is_uring_fops(file))
|
||||
return file;
|
||||
fput(file);
|
||||
if (!registered)
|
||||
fput(file);
|
||||
return ERR_PTR(-EOPNOTSUPP);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user