From: Ranganath V N <vnranganath.20@gmail.com>
To: vnranganath.20@gmail.com
Cc: brauner@kernel.org, broonie@kernel.org, jlayton@kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
shuah@kernel.org, skhan@linuxfoundation.org
Subject: [PATCH] selftests/filesystems: Fix build warning on anon_inode_test
Date: Wed, 10 Sep 2025 23:36:15 +0530 [thread overview]
Message-ID: <20250910180616.4324-1-vnranganath.20@gmail.com> (raw)
In-Reply-To: <20250730192748.39517-1-vnranganath.20@gmail.com>
>clang warning null passed where non-null argument is expected.
>
>anon_inode_test.c:45:19: warning: argument 3 null where non-null expected [-Wnonnull]
> 45 | ASSERT_LT(execveat(fd_context, "", NULL, NULL, AT_EMPTY_PATH), 0);
> | ^~~~~~~~
>
>Signed-off-by: Ranganath V N <vnranganath.20@gmail.com>
>---
> tools/testing/selftests/filesystems/anon_inode_test.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/tools/testing/selftests/filesystems/anon_inode_test.c b/tools/testing/selftests/filesystems/anon_inode_test.c
>index 73e0a4d4fb2f..f796dad679db 100644
>--- a/tools/testing/selftests/filesystems/anon_inode_test.c
>+++ b/tools/testing/selftests/filesystems/anon_inode_test.c
>@@ -38,11 +38,13 @@ TEST(anon_inode_no_chmod)
> TEST(anon_inode_no_exec)
> {
> int fd_context;
>+ static char *argv[] = { NULL };
>+ static char *envp[] = { NULL };
>
> fd_context = sys_fsopen("tmpfs", 0);
> ASSERT_GE(fd_context, 0);
>
>- ASSERT_LT(execveat(fd_context, "", NULL, NULL, AT_EMPTY_PATH), 0);
>+ ASSERT_LT(execveat(fd_context, "", argv, envp, AT_EMPTY_PATH), 0);
> ASSERT_EQ(errno, EACCES);
>
> EXPECT_EQ(close(fd_context), 0);
Hi,
Please let me know the feedback for this patch.
Thanks,
Ranganath
next prev parent reply other threads:[~2025-09-10 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-30 19:27 [PATCH] selftests/filesystems: Fix build warning on anon_inode_test Ranganath V N
2025-09-10 18:06 ` Ranganath V N [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-09-19 10:49 [RESEND PATCH] " Ranganath V N
2025-10-06 7:43 ` [PATCH] " Ranganath V N
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250910180616.4324-1-vnranganath.20@gmail.com \
--to=vnranganath.20@gmail.com \
--cc=brauner@kernel.org \
--cc=broonie@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox