Message ID | 20190823104429.11047-2-johannes@sipsolutions.net |
---|---|
State | Accepted |
Headers | show |
Series | [1/4] arch: um: remove sig_info[SIGALRM] | expand |
On 23/08/2019 11:44, Johannes Berg wrote: > From: Johannes Berg <johannes.berg@intel.com> > > 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> > --- > 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 <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); > } > > Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk>
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); }