mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
io_uring: use kvfree() in io_sqe_buffer_register()
commita8c73c1a61upstream. Use kvfree() to free the pages and vmas, since they are allocated by kvmalloc_array() in a loop. Fixes:d4ef647510("io_uring: avoid page allocation warnings") Signed-off-by: Denis Efremov <efremov@linux.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200605093203.40087-1-efremov@linux.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d4a13e6711
commit
ab2df991e5
@@ -3498,8 +3498,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,
|
||||
|
||||
Reference in New Issue
Block a user