render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From a29ee6823d600aaf40c06c67e954233c36624774 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <a29ee6823d600aaf40c06c67e954233c36624774@dist-git>
c1c534
From: Jiri Denemark <jdenemar@redhat.com>
c1c534
Date: Mon, 11 Dec 2017 14:34:20 +0100
c1c534
Subject: [PATCH] qemu: Avoid comparing size_t with -1
c1c534
c1c534
ncpus would be -1 on error and the cleanup for loop would not be skipped
c1c534
in this case.
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
Reviewed-by: John Ferlan <jferlan@redhat.com>
c1c534
(cherry picked from commit fd754cb69cb073d370d73b9eab65db8ce1400096)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1521202
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_capabilities.c | 2 +-
c1c534
 1 file changed, 1 insertion(+), 1 deletion(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
c1c534
index 4af1b6c662..165fdbc5ea 100644
c1c534
--- a/src/qemu/qemu_capabilities.c
c1c534
+++ b/src/qemu/qemu_capabilities.c
c1c534
@@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
c1c534
     size_t i;
c1c534
 
c1c534
     if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
c1c534
-        goto error;
c1c534
+        return NULL;
c1c534
 
c1c534
     if (!(models = virDomainCapsCPUModelsNew(ncpus)))
c1c534
         goto error;
c1c534
-- 
c1c534
2.15.1
c1c534