render / rpms / libvirt

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