Skip to content

Commit 61b963b

Browse files
davidhildenbrandakpm00
authored andcommitted
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: c77369b ("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>
1 parent 8fa590b commit 61b963b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/gup_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ static inline void pin_longterm_test_stop(void)
214214
if (pin_longterm_test_nr_pages)
215215
unpin_user_pages(pin_longterm_test_pages,
216216
pin_longterm_test_nr_pages);
217-
kfree(pin_longterm_test_pages);
217+
kvfree(pin_longterm_test_pages);
218218
pin_longterm_test_pages = NULL;
219219
pin_longterm_test_nr_pages = 0;
220220
}
@@ -255,7 +255,7 @@ static inline int pin_longterm_test_start(unsigned long arg)
255255
fast = !!(args.flags & PIN_LONGTERM_TEST_FLAG_USE_FAST);
256256

257257
if (!fast && mmap_read_lock_killable(current->mm)) {
258-
kfree(pages);
258+
kvfree(pages);
259259
return -EINTR;
260260
}
261261

0 commit comments

Comments
 (0)