render / rpms / libvirt

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