[LTP] [PATCH 1/2] ksm06: Free memory at the end of the test

Cyril Hrubis chrubis@suse.cz
Mon Feb 28 10:46:58 CET 2022


Fixes the kms06 run with -i 2.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/mem/lib/mem.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 99d5f7f53..39e3f1791 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -594,6 +594,11 @@ void test_ksm_merge_across_nodes(unsigned long nr_pages)
 		    0, 0, 0, nr_pages * num_nodes);
 
 	SAFE_FILE_PRINTF(PATH_KSM "run", "2");
+
+	for (i = 0; i < num_nodes; i++)
+		SAFE_MUNMAP(memory[i], length);
+
+	free(memory);
 }
 
 /* THP */
-- 
2.34.1



More information about the ltp mailing list