diff options
-rw-r--r-- | io_uring/io_uring.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 13a60f51b283..862e05e6691d 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1634,17 +1634,12 @@ queue: } spin_unlock(&ctx->completion_lock); - ret = io_req_prep_async(req); - if (ret) { -fail: - io_req_complete_failed(req, ret); - return; - } io_prep_async_link(req); de = kmalloc(sizeof(*de), GFP_KERNEL); if (!de) { ret = -ENOMEM; - goto fail; + io_req_complete_failed(req, ret); + return; } spin_lock(&ctx->completion_lock); @@ -1918,13 +1913,16 @@ static void io_queue_sqe_fallback(struct io_kiocb *req) req->flags &= ~REQ_F_HARDLINK; req->flags |= REQ_F_LINK; io_req_complete_failed(req, req->cqe.res); - } else if (unlikely(req->ctx->drain_active)) { - io_drain_req(req); } else { int ret = io_req_prep_async(req); - if (unlikely(ret)) + if (unlikely(ret)) { io_req_complete_failed(req, ret); + return; + } + + if (unlikely(req->ctx->drain_active)) + io_drain_req(req); else io_queue_iowq(req, NULL); } |