diff --git a/fs/io_uring.c b/fs/io_uring.c index 990d909966a9ddc339c2494502ac15ac0f02886b..37d0ae2db4bec0aae7967b1d6f239e7be1223032 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4281,7 +4281,9 @@ static void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx) io_wq_cancel_all(ctx->io_wq); io_iopoll_reap_events(ctx); - io_cqring_overflow_flush(ctx, true); + /* if we failed setting up the ctx, we might not have any rings */ + if (ctx->rings) + io_cqring_overflow_flush(ctx, true); wait_for_completion(&ctx->completions[0]); io_ring_ctx_free(ctx); }