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")
Signed-off-by: Sarthak Sharma <[email protected]>
---
 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 869df22d46db..3b42c4f2473c 100644
--- a/tools/testing/selftests/mm/mremap_test.c
+++ b/tools/testing/selftests/mm/mremap_test.c
@@ -691,6 +691,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


Reply via email to