summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDenis Efremov <efremov@linux.com>2020-06-05 12:32:03 +0300
committerJens Axboe <axboe@kernel.dk>2020-06-08 09:39:13 -0600
commita8c73c1a614f6da6c0b04c393f87447e28cb6de4 (patch)
treec2e0b30c6d769e024de229012f8dcf7854353270 /fs
parentefe68c1ca8f49e8c06afd74b699411bfbb8ba1ff (diff)
downloadlinux-stable-a8c73c1a614f6da6c0b04c393f87447e28cb6de4.tar.gz
linux-stable-a8c73c1a614f6da6c0b04c393f87447e28cb6de4.tar.bz2
linux-stable-a8c73c1a614f6da6c0b04c393f87447e28cb6de4.zip
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 <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
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5431b182b6b0..5e36e78e766e 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -7171,8 +7171,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,