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: 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
This commit is contained in:
Denis Efremov 2020-06-05 12:32:03 +03:00 коммит произвёл Jens Axboe
Родитель efe68c1ca8
Коммит a8c73c1a61
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -7171,8 +7171,8 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, void __user *arg,
ret = 0; ret = 0;
if (!pages || nr_pages > got_pages) { if (!pages || nr_pages > got_pages) {
kfree(vmas); kvfree(vmas);
kfree(pages); kvfree(pages);
pages = kvmalloc_array(nr_pages, sizeof(struct page *), pages = kvmalloc_array(nr_pages, sizeof(struct page *),
GFP_KERNEL); GFP_KERNEL);
vmas = kvmalloc_array(nr_pages, vmas = kvmalloc_array(nr_pages,