All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] selftests-mm-fix-mmap-return-value-check-in-run_migration_benchmark.patch removed from -mm tree
@ 2026-06-02 22:23 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-06-02 22:23 UTC (permalink / raw)
  To: mm-commits, sj, rppt, ljs, donettom, dev.jain, david, lihongfu,
	akpm


The quilt patch titled
     Subject: selftests/mm: fix mmap() return value check in run_migration_benchmark
has been removed from the -mm tree.  Its filename was
     selftests-mm-fix-mmap-return-value-check-in-run_migration_benchmark.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Hongfu Li <lihongfu@kylinos.cn>
Subject: selftests/mm: fix mmap() return value check in run_migration_benchmark
Date: Tue, 12 May 2026 18:13:05 +0800

mmap() returns MAP_FAILED on error, not NULL.  The current check uses
!buffer->ptr, which evaluates to false when mmap() fails (since MAP_FAILED
is (void *)-1, not 0), so the error path is never taken.

Link: https://lore.kernel.org/20260512101305.139509-1-lihongfu@kylinos.cn
Signed-off-by: Hongfu Li <lihongfu@kylinos.cn>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Dev Jain <dev.jain@arm.com>
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Donet Tom <donettom@linux.ibm.com>
Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 tools/testing/selftests/mm/hmm-tests.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/testing/selftests/mm/hmm-tests.c~selftests-mm-fix-mmap-return-value-check-in-run_migration_benchmark
+++ a/tools/testing/selftests/mm/hmm-tests.c
@@ -2738,7 +2738,7 @@ static inline int run_migration_benchmar
 	buffer->ptr = mmap(NULL, buffer_size, PROT_READ | PROT_WRITE,
 			  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 
-	if (!buffer->ptr)
+	if (buffer->ptr == MAP_FAILED)
 		return -1;
 
 	/* Apply THP hint if requested */
_

Patches currently in -mm which might be from lihongfu@kylinos.cn are

selftests-mm-fix-incorrect-mmap-error-handling-with-null-instead-of-map_failed.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-02 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-02 22:23 [merged mm-stable] selftests-mm-fix-mmap-return-value-check-in-run_migration_benchmark.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.