7a3408
From b787e0f4846d1175c5ed7dd8aeecb4b78eaf0c47 Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <b787e0f4846d1175c5ed7dd8aeecb4b78eaf0c47@dist-git>
7a3408
From: Andrea Bolognani <abologna@redhat.com>
7a3408
Date: Tue, 11 Aug 2015 17:15:55 +0200
7a3408
Subject: [PATCH] cpu: Simplify ppc64ModelFromCPU()
7a3408
7a3408
(cherry picked from commit c238d16af4fccfb829274c1a4dbf2748d81f7714)
7a3408
7a3408
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1250977
7a3408
7a3408
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/cpu/cpu_ppc64.c | 11 ++---------
7a3408
 1 file changed, 2 insertions(+), 9 deletions(-)
7a3408
7a3408
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
7a3408
index 05ff8f2..18dbf86 100644
7a3408
--- a/src/cpu/cpu_ppc64.c
7a3408
+++ b/src/cpu/cpu_ppc64.c
7a3408
@@ -163,17 +163,10 @@ ppc64ModelFromCPU(const virCPUDef *cpu,
7a3408
     if (!(model = ppc64ModelFind(map, cpu->model))) {
7a3408
         virReportError(VIR_ERR_INTERNAL_ERROR,
7a3408
                        _("Unknown CPU model %s"), cpu->model);
7a3408
-        goto error;
7a3408
+        return NULL;
7a3408
     }
7a3408
 
7a3408
-    if (!(model = ppc64ModelCopy(model)))
7a3408
-        goto error;
7a3408
-
7a3408
-    return model;
7a3408
-
7a3408
- error:
7a3408
-    ppc64ModelFree(model);
7a3408
-    return NULL;
7a3408
+    return ppc64ModelCopy(model);
7a3408
 }
7a3408
 
7a3408
 
7a3408
-- 
7a3408
2.5.0
7a3408