[libvirt] [PATCH 08/14] xenconfig: Remove pointless label in xenParseSxprSound

Peter Krempa pkrempa at redhat.com
Wed Jul 3 12:38:00 UTC 2019


The 'error' label just returned -1. Inline it.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/xenconfig/xen_sxpr.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c
index 4328875475..7404aac071 100644
--- a/src/xenconfig/xen_sxpr.c
+++ b/src/xenconfig/xen_sxpr.c
@@ -303,13 +303,13 @@ xenParseSxprSound(virDomainDefPtr def,

         if (VIR_ALLOC_N(def->sounds,
                         VIR_DOMAIN_SOUND_MODEL_ES1370 + 1) < 0)
-            goto error;
+            return -1;


         for (i = 0; i < (VIR_DOMAIN_SOUND_MODEL_ES1370 + 1); i++) {
             virDomainSoundDefPtr sound;
             if (VIR_ALLOC(sound) < 0)
-                goto error;
+                return -1;
             sound->model = i;
             def->sounds[def->nsounds++] = sound;
         }
@@ -329,20 +329,20 @@ xenParseSxprSound(virDomainDefPtr def,
                 virReportError(VIR_ERR_INTERNAL_ERROR,
                                _("Sound model %s too big for destination"),
                                offset);
-                goto error;
+                return -1;
             }

             if (VIR_ALLOC(sound) < 0)
-                goto error;
+                return -1;

             if ((sound->model = virDomainSoundModelTypeFromString(model)) < 0) {
                 VIR_FREE(sound);
-                goto error;
+                return -1;
             }

             if (VIR_APPEND_ELEMENT(def->sounds, def->nsounds, sound) < 0) {
                 virDomainSoundDefFree(sound);
-                goto error;
+                return -1;
             }

             offset = offset2 ? offset2 + 1 : NULL;
@@ -350,7 +350,4 @@ xenParseSxprSound(virDomainDefPtr def,
     }

     return 0;
-
- error:
-    return -1;
 }
-- 
2.21.0




More information about the libvir-list mailing list