diff --git a/hw/vmport.c b/hw/vmport.c index 19010e4..316cf1d 100644 --- a/hw/vmport.c +++ b/hw/vmport.c @@ -61,6 +61,9 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t addr) unsigned char command; uint32_t eax; + if (env == NULL) + return 0; + cpu_synchronize_state(env); eax = env->regs[R_EAX]; @@ -85,6 +88,9 @@ static void vmport_ioport_write(void *opaque, uint32_t addr, uint32_t val) { CPUState *env = cpu_single_env; + if (env == NULL) + return; + env->regs[R_EAX] = vmport_ioport_read(opaque, addr); }