[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230929112039.7488-2-ilpo.jarvinen@linux.intel.com>
Date: Fri, 29 Sep 2023 14:20:33 +0300
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: linux-kselftest@...r.kernel.org, Shuah Khan <shuah@...nel.org>,
Reinette Chatre <reinette.chatre@...el.com>,
Maciej Wieczór-Retman
<maciej.wieczor-retman@...el.com>,
Shaopeng Tan <tan.shaopeng@...fujitsu.com>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Subject: [PATCH v3 1/7] selftests/resctrl: Fix uninitialized .sa_flags
signal_handler_unregister() calls sigaction() with uninitializing
sa_flags in the struct sigaction.
Make sure sa_flags is always initialized in signal_handler_unregister()
by initializing the struct sigaction when declaring it.
Fixes: 73c55fa5ab55 (selftests/resctrl: Commonize the signal handler register/unregister for all tests)
Suggested-by: Reinette Chatre <reinette.chatre@...el.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: <stable@...r.kernel.org>
---
tools/testing/selftests/resctrl/resctrl_val.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c
index 51963a6f2186..1e8b90077218 100644
--- a/tools/testing/selftests/resctrl/resctrl_val.c
+++ b/tools/testing/selftests/resctrl/resctrl_val.c
@@ -504,7 +504,7 @@ int signal_handler_register(void)
*/
void signal_handler_unregister(void)
{
- struct sigaction sigact;
+ struct sigaction sigact = {};
sigact.sa_handler = SIG_DFL;
sigemptyset(&sigact.sa_mask);
--
2.30.2
Powered by blists - more mailing lists