Commit f31de6c4 authored by Mickaël Salaün's avatar Mickaël Salaün Committed by Wentao Guan
Browse files

selftests/landlock: Fix error message

stable inclusion
from stable-v6.6.76
commit 627f67b6d0999361abcfd5514f731070da93f6fd
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBW08Q

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=627f67b6d0999361abcfd5514f731070da93f6fd

--------------------------------

[ 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: e1199815 ("selftests/landlock: Add user space tests")
Link: https://lore.kernel.org/r/20250108154338.1129069-21-mic@digikod.net


Signed-off-by: default avatarMickaël Salaün <mic@digikod.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit 627f67b6d0999361abcfd5514f731070da93f6fd)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent 5ec0d692
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1861,8 +1861,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);
	};
}