Skip to content

Commit a8c73c1

Browse files
evdenisaxboe
authored andcommitted
io_uring: use kvfree() in io_sqe_buffer_register()
Use kvfree() to free the pages and vmas, since they are allocated by kvmalloc_array() in a loop. Fixes: d4ef647 ("io_uring: avoid page allocation warnings") Signed-off-by: Denis Efremov <[email protected]> Signed-off-by: Jens Axboe <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent efe68c1 commit a8c73c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/io_uring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7171,8 +7171,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
71717171

71727172
ret = 0;
71737173
if (!pages || nr_pages > got_pages) {
7174-
kfree(vmas);
7175-
kfree(pages);
7174+
kvfree(vmas);
7175+
kvfree(pages);
71767176
pages = kvmalloc_array(nr_pages, sizeof(struct page *),
71777177
GFP_KERNEL);
71787178
vmas = kvmalloc_array(nr_pages,

0 commit comments

Comments
 (0)