aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_kasan.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/test_kasan.c')
-rw-r--r--lib/test_kasan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index 98854a64b014..ec657105edbf 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -567,7 +567,15 @@ static noinline void __init kmem_cache_invalid_free(void)
567 return; 567 return;
568 } 568 }
569 569
570 /* Trigger invalid free, the object doesn't get freed */
570 kmem_cache_free(cache, p + 1); 571 kmem_cache_free(cache, p + 1);
572
573 /*
574 * Properly free the object to prevent the "Objects remaining in
575 * test_cache on __kmem_cache_shutdown" BUG failure.
576 */
577 kmem_cache_free(cache, p);
578
571 kmem_cache_destroy(cache); 579 kmem_cache_destroy(cache);
572} 580}
573 581