render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Pablo Greco 40546a
From 612913a764992dc1a9ae63762749ecee447427d7 Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <612913a764992dc1a9ae63762749ecee447427d7@dist-git>
Pablo Greco 40546a
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
Pablo Greco 40546a
Date: Fri, 21 Jun 2019 09:24:45 +0200
Pablo Greco 40546a
Subject: [PATCH] cpu: fix cleanup when signature parsing fails
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
Two pieces of code accidentally jumped to the wrong label when they
Pablo Greco 40546a
failed causing incorrect cleanup, returning a partially initialized
Pablo Greco 40546a
CPU model struct.
Pablo Greco 40546a
Pablo Greco 40546a
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Pablo Greco 40546a
(cherry picked from commit 118fcdd480ad38a3e8477f466f6a876dce7e9fa6)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1686895
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Message-Id: <5e9aedc6fd4f4570322a7d13626863bec0449283.1561068591.git.jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/cpu/cpu_x86.c | 4 ++--
Pablo Greco 40546a
 1 file changed, 2 insertions(+), 2 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
Pablo Greco 40546a
index 89baf94d7d..124aa5fd5e 100644
Pablo Greco 40546a
--- a/src/cpu/cpu_x86.c
Pablo Greco 40546a
+++ b/src/cpu/cpu_x86.c
Pablo Greco 40546a
@@ -1250,7 +1250,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
Pablo Greco 40546a
             virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                            _("Invalid CPU signature family in model %s"),
Pablo Greco 40546a
                            model->name);
Pablo Greco 40546a
-            goto cleanup;
Pablo Greco 40546a
+            goto error;
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
         rc = virXPathUInt("string(./signature/@model)", ctxt, &sigModel);
Pablo Greco 40546a
@@ -1258,7 +1258,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
Pablo Greco 40546a
             virReportError(VIR_ERR_INTERNAL_ERROR,
Pablo Greco 40546a
                            _("Invalid CPU signature model in model %s"),
Pablo Greco 40546a
                            model->name);
Pablo Greco 40546a
-            goto cleanup;
Pablo Greco 40546a
+            goto error;
Pablo Greco 40546a
         }
Pablo Greco 40546a
 
Pablo Greco 40546a
         model->signature = x86MakeSignature(sigFamily, sigModel, 0);
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.22.0
Pablo Greco 40546a