]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix early fdput() of file
authorJens Axboe <axboe@kernel.dk>
Thu, 22 Jul 2021 23:08:07 +0000 (17:08 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 Jul 2021 23:11:46 +0000 (17:11 -0600)
commit2c0b5c87544865efec92e837acb985f3abed991a
tree16f36180e934e00fe2f5b34f37efadb21f8e2b53
parent3bd8229ecdffc072d90cf319d6d2c4e2a8ffd159
io_uring: fix early fdput() of file

A previous commit shuffled some code around, and inadvertently used
struct file after fdput() had been called on it. As we can't touch
the file post fdput() dropping our reference, move the fdput() to
after that has been done.

Cc: Pavel Begunkov <asml.silence@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/io-uring/YPnqM0fY3nM5RdRI@zeniv-ca.linux.org.uk/
Fixes: c433310642c0 ("io_uring: refactor io_sq_offload_create()")
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c