The patch titled Subject: selftests: mm: fix failure case when new remap region was not found has been added to the -mm mm-unstable branch. Its filename is selftests-mm-fix-failure-case-when-new-remap-region-was-not-found.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-fix-failure-case-when-new-remap-region-was-not-found.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "Joel Fernandes (Google)" <joel@xxxxxxxxxxxxxxxxx> Subject: selftests: mm: fix failure case when new remap region was not found Date: Sun, 3 Sep 2023 15:13:24 +0000 When a valid remap region could not be found, the source mapping is not cleaned up. Fix the goto statement such that the clean up happens. Link: https://lkml.kernel.org/r/20230903151328.2981432-4-joel@xxxxxxxxxxxxxxxxx Signed-off-by: Joel Fernandes (Google) <joel@xxxxxxxxxxxxxxxxx> Reviewed-by: Lorenzo Stoakes <lstoakes@xxxxxxxxx> Cc: Kalesh Singh <kaleshsingh@xxxxxxxxxx> Cc: "Kirill A. Shutemov" <kirill@xxxxxxxxxxxxx> Cc: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> Cc: Lokesh Gidra <lokeshgidra@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Paul E. McKenney <paulmck@xxxxxxxxxx> Cc: Shuah Khan <shuah@xxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/mm/mremap_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/selftests/mm/mremap_test.c~selftests-mm-fix-failure-case-when-new-remap-region-was-not-found +++ a/tools/testing/selftests/mm/mremap_test.c @@ -316,7 +316,7 @@ static long long remap_region(struct con if (addr + c.dest_alignment < addr) { ksft_print_msg("Couldn't find a valid region to remap to\n"); ret = -1; - goto out; + goto clean_up_src; } addr += c.dest_alignment; } _ Patches currently in -mm which might be from joel@xxxxxxxxxxxxxxxxx are mm-vmalloc-add-a-safer-version-of-find_vm_area-for-debug.patch mm-mremap-optimize-the-start-addresses-in-move_page_tables.patch mm-mremap-allow-moves-within-the-same-vma-for-stack-moves.patch selftests-mm-fix-failure-case-when-new-remap-region-was-not-found.patch selftests-mm-add-a-test-for-mutually-aligned-moves-pmd-size.patch selftests-mm-add-a-test-for-remapping-to-area-immediately-after-existing-mapping.patch selftests-mm-add-a-test-for-remapping-within-a-range.patch selftests-mm-add-a-test-for-moving-from-an-offset-from-start-of-mapping.patch