Skip to content

Commit f841ad9

Browse files
cyanyang-sifiveakpm00
authored andcommitted
selftests/mm/cow: fix the incorrect error handling
Error handling doesn't check the correct return value. This patch will fix it. Link: https://lkml.kernel.org/r/20250312043840.71799-1-cyan.yang@sifive.com Fixes: f4b5fd6 ("selftests/vm: anon_cow: THP tests") Signed-off-by: Cyan Yang <cyan.yang@sifive.com> Reviewed-by: Dev Jain <dev.jain@arm.com> Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: David Hildenbrand <david@redhat.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 456620c commit f841ad9

File tree

1 file changed

+1
-1
lines changed
  • tools/testing/selftests/mm

1 file changed

+1
-1
lines changed

tools/testing/selftests/mm/cow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ static void do_run_with_thp(test_fn fn, enum thp_run thp_run, size_t thpsize)
876876
mremap_size = thpsize / 2;
877877
mremap_mem = mmap(NULL, mremap_size, PROT_NONE,
878878
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
879-
if (mem == MAP_FAILED) {
879+
if (mremap_mem == MAP_FAILED) {
880880
ksft_test_result_fail("mmap() failed\n");
881881
goto munmap;
882882
}

0 commit comments

Comments
 (0)