diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-25 11:51:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-25 11:51:21 +0300 |
commit | 7f0020417b7bceaa10cf9e1efe2b3f5c554d972e (patch) | |
tree | 69d11757acfb4bacfb5f82f6f0fbf04339b3cd38 /io_uring/rsrc.c | |
parent | 616e143c9fd88562b4d2cb235834c620fe65ba22 (diff) | |
parent | ea061bad207e1ba693b5488ba64c663f7ca03f50 (diff) | |
download | linux-rolling-stable.tar.xz |
Merge v6.14.4linux-rolling-stable
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/rsrc.c')
-rw-r--r-- | io_uring/rsrc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index af39b69eb4fd..dbb94d93279b 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -130,6 +130,18 @@ struct io_rsrc_node *io_rsrc_node_alloc(int type) return node; } +static void io_clear_table_tags(struct io_rsrc_data *data) +{ + int i; + + for (i = 0; i < data->nr; i++) { + struct io_rsrc_node *node = data->nodes[i]; + + if (node) + node->tag = 0; + } +} + __cold void io_rsrc_data_free(struct io_ring_ctx *ctx, struct io_rsrc_data *data) { if (!data->nr) @@ -539,6 +551,7 @@ int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg, io_file_table_set_alloc_range(ctx, 0, ctx->file_table.data.nr); return 0; fail: + io_clear_table_tags(&ctx->file_table.data); io_sqe_files_unregister(ctx); return ret; } @@ -855,8 +868,10 @@ int io_sqe_buffers_register(struct io_ring_ctx *ctx, void __user *arg, } ctx->buf_table = data; - if (ret) + if (ret) { + io_clear_table_tags(&ctx->buf_table); io_sqe_buffers_unregister(ctx); + } return ret; } |