diff mbox series

[2/6] mdadm: signal_s() init variables

Message ID 20240220105612.31058-3-mateusz.kusiak@intel.com (mailing list archive)
State Accepted
Headers show
Series SAST fixes | expand

Commit Message

Mateusz Kusiak Feb. 20, 2024, 10:56 a.m. UTC
Init sigaction structs in signal_s().
This approach might throw warnings for GCC 4.x and lower.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
---
 mdadm.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/mdadm.h b/mdadm.h
index 1f28b3e754be..75c887e4c64c 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1856,11 +1856,10 @@  static inline char *to_subarray(struct mdstat_ent *ent, char *container)
  */
 static inline sighandler_t signal_s(int sig, sighandler_t handler)
 {
-	struct sigaction new_act;
-	struct sigaction old_act;
+	struct sigaction new_act = {0};
+	struct sigaction old_act = {0};
 
 	new_act.sa_handler = handler;
-	new_act.sa_flags = 0;
 
 	if (sigaction(sig, &new_act, &old_act) == 0)
 		return old_act.sa_handler;