On Tue, Jul 07, 2026 at 11:17:45AM +0800, longlong yan wrote:
> The return value for a failed mmap function is MAP_FAILED.
> According to the definition of FAIL_TEST_IF FALSE,ptr must be
> determined to be distinct from MAP_FAILED
> 
> Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing")
> Signed-off-by: longlong yan <[email protected]>

Acked-by: Mike Rapoport (Microsoft) <[email protected]>

> ---
>  tools/testing/selftests/mm/mseal_test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/mm/mseal_test.c 
> b/tools/testing/selftests/mm/mseal_test.c
> index faad4833366a..277c8fda3f5e 100644
> --- a/tools/testing/selftests/mm/mseal_test.c
> +++ b/tools/testing/selftests/mm/mseal_test.c
> @@ -482,7 +482,7 @@ static void test_seal_zero_address(void)
>       /* use mmap to change protection. */
>       ptr = mmap(0, size, PROT_NONE,
>                  MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0);
> -     FAIL_TEST_IF_FALSE(ptr == 0);
> +     FAIL_TEST_IF_FALSE(ptr != (void *)-1);
>  
>       size = get_vma_size(ptr, &prot);
>       FAIL_TEST_IF_FALSE(size == 4 * page_size);
> -- 
> 2.43.0
> 

-- 
Sincerely yours,
Mike.

Reply via email to