diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2025-05-13 18:26:48 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-05-13 14:45:55 -0600 |
commit | 4e9fda29d66b06caf5c81b8acbe0a504effc73fb (patch) | |
tree | f8b02c78ce24d2f5d06b48a6e38b2ea871a230d2 | |
parent | 1724849072854a66861d461b298b04612702d685 (diff) |
io_uring/kbuf: drop extra vars in io_register_pbuf_ring
bl and free_bl variables in io_register_pbuf_ring() always point to the
same list since we started to reallocate the pre-existent list. Drop
free_bl.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d45c3342d74c9030f99376c777a4b3d59089074d.1747150490.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | io_uring/kbuf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index 344517d1d921..406e8a9b42c3 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -591,7 +591,7 @@ err: int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) { struct io_uring_buf_reg reg; - struct io_buffer_list *bl, *free_bl = NULL; + struct io_buffer_list *bl; struct io_uring_region_desc rd; struct io_uring_buf_ring *br; unsigned long mmap_offset; @@ -620,7 +620,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) io_destroy_bl(ctx, bl); } - free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); + bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); if (!bl) return -ENOMEM; @@ -665,7 +665,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) return 0; fail: io_free_region(ctx, &bl->region); - kfree(free_bl); + kfree(bl); return ret; } |