mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
68c15a2bc5
commit
b8f7882028
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue