]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/landlock: Fix error message
authorMickaël Salaün <mic@digikod.net>
Wed, 8 Jan 2025 15:43:28 +0000 (16:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:49:59 +0000 (12:49 +0100)
[ Upstream commit 2107c35128ad751b201eb92fe91443450d9e5c37 ]

The global variable errno may not be set in test_execute().  Do not use
it in related error message.

Cc: Günther Noack <gnoack@google.com>
Fixes: e1199815b47b ("selftests/landlock: Add user space tests")
Link: https://lore.kernel.org/r/20250108154338.1129069-21-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/landlock/fs_test.c

index ea988b3d6b2edc8d86ecce51fc4144c5335585dc..47fc4392f412ec1e6f1a956ebb00f9ea80dfacf0 100644 (file)
@@ -1767,8 +1767,7 @@ static void test_execute(struct __test_metadata *const _metadata, const int err,
        ASSERT_EQ(1, WIFEXITED(status));
        ASSERT_EQ(err ? 2 : 0, WEXITSTATUS(status))
        {
-               TH_LOG("Unexpected return code for \"%s\": %s", path,
-                      strerror(errno));
+               TH_LOG("Unexpected return code for \"%s\"", path);
        };
 }