Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: f4b5fd6946e2 ("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>

authored by

Cyan Yang and committed by
Andrew Morton
f841ad9c 456620c5

+1 -1
+1 -1
tools/testing/selftests/mm/cow.c
··· 876 876 mremap_size = thpsize / 2; 877 877 mremap_mem = mmap(NULL, mremap_size, PROT_NONE, 878 878 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); 879 - if (mem == MAP_FAILED) { 879 + if (mremap_mem == MAP_FAILED) { 880 880 ksft_test_result_fail("mmap() failed\n"); 881 881 goto munmap; 882 882 }