[PATCH] selftests/statmount: initialize the byte written to the child

From: Sasha Levin

Date: Tue Nov 03 2026 - 13:45:11 EST


test_listmount_ns() writes pval to the child only to let it exit, but
never sets it, and clang 21 warns:

statmount_test_ns.c:334:35: warning: variable 'pval' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer]

Initialize it to 0.

Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
Found with clang 21; KernelCI's clang builds show the same warning.

.../testing/selftests/filesystems/statmount/statmount_test_ns.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/filesystems/statmount/statmount_test_ns.c b/tools/testing/selftests/filesystems/statmount/statmount_test_ns.c
index e500905e4c078..e7261d4f3be4e 100644
--- a/tools/testing/selftests/filesystems/statmount/statmount_test_ns.c
+++ b/tools/testing/selftests/filesystems/statmount/statmount_test_ns.c
@@ -275,7 +275,7 @@ static int validate_external_listmount(pid_t pid, uint64_t child_nr_mounts)
static void test_listmount_ns(void)
{
uint64_t nr_mounts;
- char pval;
+ char pval = 0;
int child_ready_pipe[2];
int parent_ready_pipe[2];
pid_t pid;
--
2.53.0