From 4f8eb8daebd72bdc214c63a3b2577f95bbadb27d Mon Sep 17 00:00:00 2001 From: balrog Date: Sun, 16 Dec 2007 12:39:38 +0000 Subject: [PATCH] =?utf8?q?Work=20around=20a=20crash=20when=20timer=20signa?= =?utf8?q?l=20occurs=20before=20main=20loop,=20original=20patch=20by=20?= =?utf8?q?=E6=AD=A6=E7=94=B0=20=E4=BF=8A=E4=B9=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3820 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/pxa2xx_keypad.c | 2 -- vl.c | 12 +++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/pxa2xx_keypad.c b/hw/pxa2xx_keypad.c index b67b2cb845..c6c7528b63 100644 --- a/hw/pxa2xx_keypad.c +++ b/hw/pxa2xx_keypad.c @@ -332,8 +332,6 @@ struct pxa2xx_keypad_s *pxa27x_keypad_init(target_phys_addr_t base, void pxa27x_register_keypad(struct pxa2xx_keypad_s *kp, struct keymap *map, int size) { - kp->map = (struct keymap *) qemu_mallocz(sizeof(struct keymap) * size); - if(!map || size < 0x80) { fprintf(stderr, "%s - No PXA keypad map defined\n", __FUNCTION__); exit(-1); diff --git a/vl.c b/vl.c index a4592f7bd0..2ed3254345 100644 --- a/vl.c +++ b/vl.c @@ -1186,13 +1186,15 @@ static void host_alarm_handler(int host_signum) #endif CPUState *env = next_cpu; - /* stop the currently executing cpu because a timer occured */ - cpu_interrupt(env, CPU_INTERRUPT_EXIT); + if (env) { + /* stop the currently executing cpu because a timer occured */ + cpu_interrupt(env, CPU_INTERRUPT_EXIT); #ifdef USE_KQEMU - if (env->kqemu_enabled) { - kqemu_cpu_interrupt(env); - } + if (env->kqemu_enabled) { + kqemu_cpu_interrupt(env); + } #endif + } event_pending = 1; } } -- 2.11.0