On 30/06/2026 09:32, Hongfu Li wrote:
> Use pkey_assert(0) instead of perror("clone") when clone_raw() fails.
> The old path only printed an error and continued; the test now exits
> via pkey_assert() on failure so it does not hang or proceed with an
> invalid child.
>
> Signed-off-by: Hongfu Li <[email protected]>

Reviewed-by: Kevin Brodsky <[email protected]>

> ---
>  tools/testing/selftests/mm/pkey_sighandler_tests.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/pkey_sighandler_tests.c 
> b/tools/testing/selftests/mm/pkey_sighandler_tests.c
> index 085e771227fb..882928f2912b 100644
> --- a/tools/testing/selftests/mm/pkey_sighandler_tests.c
> +++ b/tools/testing/selftests/mm/pkey_sighandler_tests.c
> @@ -333,7 +333,7 @@ static void 
> test_sigsegv_handler_with_different_pkey_for_stack(void)
>  
>       if (ret < 0) {
>               errno = -ret;
> -             perror("clone");
> +             pkey_assert(0);
>       } else if (ret == 0) {
>               thread_segv_maperr_ptr(&sigstack);
>               syscall_raw(SYS_exit, 0, 0, 0, 0, 0, 0);
> @@ -506,7 +506,7 @@ static void test_pkru_sigreturn(void)
>  
>       if (ret < 0) {
>               errno = -ret;
> -             perror("clone");
> +             pkey_assert(0);
>       }  else if (ret == 0) {
>               thread_sigusr2_self(&sigstack);
>               syscall_raw(SYS_exit, 0, 0, 0, 0, 0, 0);

Reply via email to