]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu: Avoid NULL dereference
authorJohn Ferlan <jferlan@redhat.com>
Mon, 7 Jan 2013 17:09:34 +0000 (12:09 -0500)
committerEric Blake <eblake@redhat.com>
Tue, 8 Jan 2013 00:11:57 +0000 (17:11 -0700)
Don't dereference 'model' in PowerPCBaseline when there's no outputModel

src/cpu/cpu_powerpc.c

index 8bef6271fef40f6fa7b1ae270c841589169fd7e3..5e1a7b9c9220ef808041fb4ad4c96b5c418dac8e 100644 (file)
@@ -605,7 +605,8 @@ PowerPCBaseline(virCPUDefPtr *cpus,
         goto error;
     }
 
-    base_model->data->ppc.pvr = model->data->ppc.pvr;
+    if (outputModel)
+        base_model->data->ppc.pvr = model->data->ppc.pvr;
     if (PowerPCDecode(cpu, base_model->data, models, nmodels, NULL) < 0)
         goto error;