[libvirt] [PATCH v3 03/20] cpu: Simplify ppc64ModelFromCPU()

Andrea Bolognani abologna at redhat.com
Mon Aug 10 08:55:45 UTC 2015


---
 src/cpu/cpu_ppc64.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
index 05ff8f2..18dbf86 100644
--- a/src/cpu/cpu_ppc64.c
+++ b/src/cpu/cpu_ppc64.c
@@ -163,17 +163,10 @@ ppc64ModelFromCPU(const virCPUDef *cpu,
     if (!(model = ppc64ModelFind(map, cpu->model))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Unknown CPU model %s"), cpu->model);
-        goto error;
+        return NULL;
     }
 
-    if (!(model = ppc64ModelCopy(model)))
-        goto error;
-
-    return model;
-
- error:
-    ppc64ModelFree(model);
-    return NULL;
+    return ppc64ModelCopy(model);
 }
 
 
-- 
2.4.3




More information about the libvir-list mailing list