diff --git a/fs/io_uring.c b/fs/io_uring.c index 3229b34e0fe09a87ca4e7216ffe04ed53f4dc05e..efad9106576be47e4a89f5def473dbc17ed47e0d 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2769,8 +2769,10 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx) io_eventfd_unregister(ctx); #if defined(CONFIG_UNIX) - if (ctx->ring_sock) + if (ctx->ring_sock) { + ctx->ring_sock->file = NULL; /* so that iput() is called */ sock_release(ctx->ring_sock); + } #endif io_mem_free(ctx->sq_ring);