diff options
author | Johannes Berg <johannes.berg@intel.com> | 2019-08-23 12:44:27 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2019-09-15 21:37:10 +0200 |
commit | b8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035 (patch) | |
tree | 95f3ef3ff5f9e536cbc2870ee5459ff23258dcdb /arch/um | |
parent | um: Remove sig_info[SIGALRM] (diff) | |
download | linux-b8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035.tar.xz linux-b8f7882028ec6a5f147aa4e0cb27f0b9ffdc6035.zip |
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')
-rw-r--r-- | arch/um/os-Linux/signal.c | 3 |
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(®s, mc); + else + memset(®s, 0, sizeof(regs)); timer_handler(SIGALRM, NULL, ®s); } |