[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found |
Date: |
Tue, 12 Mar 2013 10:49:02 +0100 |
From: Igor Mammedov <address@hidden>
Commit 55e5c2850 breaks CPU not found return value, and returns
CPU corresponding to the last non NULL env.
Fix it by returning CPU only if env is not NULL, otherwise CPU is
not found and function should return NULL.
Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
exec.c | 2 +-
1 Datei geändert, 1 Zeile hinzugefügt(+), 1 Zeile entfernt(-)
diff --git a/exec.c b/exec.c
index 46a2830..0a96ddb 100644
--- a/exec.c
+++ b/exec.c
@@ -260,7 +260,7 @@ CPUState *qemu_get_cpu(int index)
env = env->next_cpu;
}
- return cpu;
+ return env ? cpu : NULL;
}
void cpu_exec_init(CPUArchState *env)
--
1.7.10.4
- [Qemu-devel] [PULL 00/17] QOM CPUState patch queue 2013-03-12, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found,
Andreas Färber <=
- [Qemu-devel] [PATCH 03/17] cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu(), Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 10/17] target-i386: Update VMStateDescription to X86CPU, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 06/17] vmstate: Make vmstate_register() static inline, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 08/17] cpu: Register VMStateDescription through CPUState, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 11/17] target-cris/helper.c: Update Coding Style, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 04/17] target-sh4: Introduce SuperHCPU subclasses, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 07/17] stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 17/17] target-lm32: Update VMStateDescription to LM32CPU, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 05/17] target-sh4: Move PVR/PRR/CVR into SuperHCPUClass, Andreas Färber, 2013/03/12
- [Qemu-devel] [PATCH 09/17] cpu: Introduce cpu_class_set_vmsd(), Andreas Färber, 2013/03/12