diff --git a/fs/io_uring.c b/fs/io_uring.c index 0f25b91470d2cee1ab3039eeb030fc1fd5177ea1..20bc03ce1d57c87e6240439410c16ed527f78209 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -3363,6 +3363,8 @@ static void io_accept_finish(struct io_wq_work **workptr) struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work); struct io_kiocb *nxt = NULL; + io_put_req(req); + if (io_req_cancelled(req)) return; __io_accept(req, &nxt, false); @@ -3380,7 +3382,6 @@ static int io_accept(struct io_kiocb *req, struct io_kiocb **nxt, ret = __io_accept(req, nxt, force_nonblock); if (ret == -EAGAIN && force_nonblock) { req->work.func = io_accept_finish; - io_put_req(req); return -EAGAIN; } return 0;