Re: [libvirt] [PATCH v2 2/8] cpu: fix cleanup when signature parsing fails

2018-08-24 Thread Jiri Denemark
On Thu, Aug 16, 2018 at 13:10:25 +0100, Daniel P. Berrangé wrote:
> Two pieces of code accidentally jumped to the wrong label when they
> failed causing incorrect cleanup, returning a partially initialized
> CPU model struct.
> 
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Jiri Denemark 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH v2 2/8] cpu: fix cleanup when signature parsing fails

2018-08-16 Thread Daniel P . Berrangé
Two pieces of code accidentally jumped to the wrong label when they
failed causing incorrect cleanup, returning a partially initialized
CPU model struct.

Signed-off-by: Daniel P. Berrangé 
---
 src/cpu/cpu_x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 809da94117..a045a8280c 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1242,7 +1242,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
 virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature family in model %s"),
model->name);
-goto cleanup;
+goto error;
 }
 
 rc = virXPathUInt("string(./signature/@model)", ctxt, );
@@ -1250,7 +1250,7 @@ x86ModelParse(xmlXPathContextPtr ctxt,
 virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid CPU signature model in model %s"),
model->name);
-goto cleanup;
+goto error;
 }
 
 model->signature = x86MakeSignature(sigFamily, sigModel, 0);
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list