From b8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 23 Aug 2019 12:44:27 +0200 Subject: [PATCH] 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 Acked-by: Anton Ivanov Signed-off-by: Richard Weinberger --- arch/um/os-Linux/signal.c | 3 +++ 1 file changed, 3 insertions(+) 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 #include #include +#include #include #include #include @@ -88,6 +89,8 @@ static void timer_real_alarm_handler(mcontext_t *mc) if (mc != NULL) get_regs_from_mc(®s, mc); + else + memset(®s, 0, sizeof(regs)); timer_handler(SIGALRM, NULL, ®s); }