Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: c5e9f6a96bf7 ("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>

+2 -1
+2 -1
io_uring/io_uring.c
··· 2575 2575 return ERR_PTR(-EBADF); 2576 2576 if (io_is_uring_fops(file)) 2577 2577 return file; 2578 - fput(file); 2578 + if (!registered) 2579 + fput(file); 2579 2580 return ERR_PTR(-EOPNOTSUPP); 2580 2581 } 2581 2582