io_uring: use kvfree() in io_sqe_buffer_register()
Subsystems (3)
PATCH 1/1 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 d4ef647510b1 ("io_uring: avoid page allocation warnings")
Signed-off-by Denis Efremov <[email protected]>
---
I checked the v1 d4ef647510b1 discussion and these lines are using kvfree() https://lkml.org/lkml/2019/5/1/254. This was somehow missed in v2.
fs/io_uring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/io_uring.c +2 -2
@@ -7160,8 +7160,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg, ret =0 ;if (!pages || nr_pages > got_pages) { -kfree (vmas); -kfree (pages); +kvfree (vmas); +kvfree (pages); pages =kvmalloc_array (nr_pages,sizeof (struct page *),GFP_KERNEL ); vmas = kvmalloc_array(nr_pages,
Signature · 1 line
2.26.2
Quoted 2 lines · Denis Efremov
Use
kvfree()to free the pages and vmas, since they are allocated bykvmalloc_array()in a loop.
Applied, thanks.
Signature · 1 line
Jens Axboe