]> git.itanic.dy.fi Git - linux-stable/blobdiff - io_uring/io_uring.c
io_uring: ensure that cached task references are always put on exit
[linux-stable] / io_uring / io_uring.c
index 602da2cfd57c8f1fa23fc0fcacf9393635b4aae0..15a6f1e93e5af6fe336eefaa3898b572ab367298 100644 (file)
@@ -10951,6 +10951,9 @@ static __cold void io_ring_ctx_wait_and_kill(struct io_ring_ctx *ctx)
                io_poll_remove_all(ctx, NULL, true);
                /* if we failed setting up the ctx, we might not have any rings */
                io_iopoll_try_reap_events(ctx);
+               /* drop cached put refs after potentially doing completions */
+               if (current->io_uring)
+                       io_uring_drop_tctx_refs(current);
        }
 
        INIT_WORK(&ctx->exit_work, io_ring_exit_work);