[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 2/4] hw/arm/virt: find_machine_info: handle NULL va
From: |
Alvise Rigo |
Subject: |
[Qemu-devel] [RFC v2 2/4] hw/arm/virt: find_machine_info: handle NULL value |
Date: |
Fri, 21 Nov 2014 19:07:39 +0100 |
Signed-off-by: Alvise Rigo <address@hidden>
---
hw/arm/virt.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index e8d527d..4e7b869 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -151,6 +151,10 @@ static VirtBoardInfo *find_machine_info(const char *cpu)
{
int i;
+ if (!cpu) {
+ return NULL;
+ }
+
for (i = 0; i < ARRAY_SIZE(machines); i++) {
if (strcmp(cpu, machines[i].cpu_model) == 0) {
return &machines[i];
--
2.1.0