summaryrefslogtreecommitdiff
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2019-08-23 13:44:27 +0300
committerRichard Weinberger <richard@nod.at>2019-09-15 22:37:10 +0300
commitb8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035 (patch)
tree95f3ef3ff5f9e536cbc2870ee5459ff23258dcdb /arch/um/os-Linux
parent68c15a2bc56585e55732d45183ea4d636a83828a (diff)
downloadlinux-b8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035.tar.xz
um: Avoid using uninitialized regs
In timer_real_alarm_handler(), regs is only initialized if the context argument is non-NULL, also initialize in the other case. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/signal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c
index 35d1b2bc00cb..4cd88b5b9006 100644
--- a/arch/um/os-Linux/signal.c
+++ b/arch/um/os-Linux/signal.c
@@ -10,6 +10,7 @@
#include <stdarg.h>
#include <errno.h>
#include <signal.h>
+#include <string.h>
#include <strings.h>
#include <as-layout.h>
#include <kern_util.h>
@@ -88,6 +89,8 @@ static void timer_real_alarm_handler(mcontext_t *mc)
if (mc != NULL)
get_regs_from_mc(&regs, mc);
+ else
+ memset(&regs, 0, sizeof(regs));
timer_handler(SIGALRM, NULL, &regs);
}