We should use req_has_async_data() instead of directly testing ->async_data to see if async_data has been allocated, there is one spot slipped that doesn't follow the rule. Fixes: 016e0451e9ed0 ("io_uring: control ->async_data with a REQ_F flag") Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 40b1697e7354..7ead1507be9b 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4683,9 +4683,9 @@ static int io_sync_file_range(struct io_kiocb *req, unsigned int issue_flags) static int io_setup_async_msg(struct io_kiocb *req, struct io_async_msghdr *kmsg) { - struct io_async_msghdr *async_msg = req->async_data; + struct io_async_msghdr *async_msg; - if (async_msg) + if (req_has_async_data(req)) return -EAGAIN; if (io_alloc_async_data(req)) { kfree(kmsg->free_iov); -- 2.33.1