summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCyan Yang <cyan.yang@sifive.com>2025-03-12 12:38:40 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-10 14:44:33 +0200
commitd6134179d85be732e794fa62290e1c483e796c91 (patch)
tree79768f99f7e69599c56b91f9a15ebc29dccd39f5 /tools
parentd78e716c8ee06cc6abda52b20438ccd367d06614 (diff)
downloadlinux-d6134179d85be732e794fa62290e1c483e796c91.tar.gz
linux-d6134179d85be732e794fa62290e1c483e796c91.tar.bz2
linux-d6134179d85be732e794fa62290e1c483e796c91.zip
selftests/mm/cow: fix the incorrect error handling
[ Upstream commit f841ad9ca5007167c02de143980c9dc703f90b3d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/mm/cow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/mm/cow.c b/tools/testing/selftests/mm/cow.c
index 9446673645eb..f0cb14ea8608 100644
--- a/tools/testing/selftests/mm/cow.c
+++ b/tools/testing/selftests/mm/cow.c
@@ -876,7 +876,7 @@ static void do_run_with_thp(test_fn fn, enum thp_run thp_run, size_t thpsize)
mremap_size = thpsize / 2;
mremap_mem = mmap(NULL, mremap_size, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (mem == MAP_FAILED) {
+ if (mremap_mem == MAP_FAILED) {
ksft_test_result_fail("mmap() failed\n");
goto munmap;
}