[PATCH v2 07/12] selftests/mm: mremap_test: fail on data corruption

From: Sarthak Sharma

Date: Tue Oct 06 2026 - 05:31:45 EST


In mremap_move_multiple_vmas_split(), if data is corrupted
after mremap, the control jumps to cleanup without marking
the test as failed.

Set success to false before moving to cleanup.

Fixes: 7d6597dfef11 ("tools/testing/selftests: explicitly test split multi VMA mremap move")
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Signed-off-by: Sarthak Sharma <sarthak.sharma@xxxxxxx>
---
tools/testing/selftests/mm/mremap_test.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/mm/mremap_test.c b/tools/testing/selftests/mm/mremap_test.c
index 1baf6374ec67..833efa85e5c6 100644
--- a/tools/testing/selftests/mm/mremap_test.c
+++ b/tools/testing/selftests/mm/mremap_test.c
@@ -682,6 +682,7 @@ static void mremap_move_multiple_vmas_split(unsigned int pattern_seed,
if (chr != buf[j]) {
ksft_print_msg("page %d offset %d corrupted, expected %d got %d\n",
i, j, chr, buf[j]);
+ success = false;
goto out_unmap;
}
}
--
2.53.0