qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [PATCH] arm: virt: Fix the segmentation fault when specifying


From: Shannon Zhao
Subject: [Qemu-arm] [PATCH] arm: virt: Fix the segmentation fault when specifying an unsupported CPU
Date: Sun, 15 Jan 2017 18:51:02 +0800

From: Shannon Zhao <address@hidden>

For example, using -cpu generic will cause qemu segmentation fault.

Signed-off-by: Shannon Zhao <address@hidden>
---
 hw/arm/virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7a03f84..4b301c2 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -175,7 +175,7 @@ static bool cpuname_valid(const char *cpu)
     int i;
 
     for (i = 0; i < ARRAY_SIZE(valid_cpus); i++) {
-        if (strcmp(cpu, valid_cpus[i]) == 0) {
+        if (valid_cpus[i] != NULL && strcmp(cpu, valid_cpus[i]) == 0) {
             return true;
         }
     }
-- 
2.0.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]