]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Avoid comparing size_t with -1
authorJiri Denemark <jdenemar@redhat.com>
Mon, 11 Dec 2017 13:34:20 +0000 (14:34 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 11 Dec 2017 13:56:22 +0000 (14:56 +0100)
ncpus would be -1 on error and the cleanup for loop would not be skipped
in this case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/qemu/qemu_capabilities.c

index 8c65de956ef82697c9ea38f46828bf8904da7bac..9673ef857b545bb20c9f1e94ba5d92807b5a812f 100644 (file)
@@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
     size_t i;
 
     if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
-        goto error;
+        return NULL;
 
     if (!(models = virDomainCapsCPUModelsNew(ncpus)))
         goto error;