summaryrefslogtreecommitdiff
path: root/mm/gup_test.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2022-12-12 21:20:18 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-12-16 03:37:48 +0300
commit61b963b52f59524e27692bc1c14bfb2459e32eb3 (patch)
treeae13bc83e9b809e708372f9c158b2a53c12b85c0 /mm/gup_test.c
parent8fa590bf344816c925810331eea8387627bbeb40 (diff)
downloadlinux-61b963b52f59524e27692bc1c14bfb2459e32eb3.tar.xz
mm/gup_test: free memory allocated via kvcalloc() using kvfree()
We have to free via kvfree(), not via kfree(). Link: https://lkml.kernel.org/r/20221212182018.264900-1-david@redhat.com Fixes: c77369b437f9 ("mm/gup_test: start/stop/read functionality for PIN LONGTERM test") Signed-off-by: David Hildenbrand <david@redhat.com> Reported-by: kernel test robot <lkp@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/gup_test.c')
-rw-r--r--mm/gup_test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/gup_test.c b/mm/gup_test.c
index 33f431e0da60..8ae7307a1bb6 100644
--- a/mm/gup_test.c
+++ b/mm/gup_test.c
@@ -214,7 +214,7 @@ static inline void pin_longterm_test_stop(void)
if (pin_longterm_test_nr_pages)
unpin_user_pages(pin_longterm_test_pages,
pin_longterm_test_nr_pages);
- kfree(pin_longterm_test_pages);
+ kvfree(pin_longterm_test_pages);
pin_longterm_test_pages = NULL;
pin_longterm_test_nr_pages = 0;
}
@@ -255,7 +255,7 @@ static inline int pin_longterm_test_start(unsigned long arg)
fast = !!(args.flags & PIN_LONGTERM_TEST_FLAG_USE_FAST);
if (!fast && mmap_read_lock_killable(current->mm)) {
- kfree(pages);
+ kvfree(pages);
return -EINTR;
}