[PATCH 5/5] virNetDevOpenvswitchGetVhostuserIfname: Drop cleanup label

Michal Privoznik mprivozn at redhat.com
Wed May 13 11:23:02 UTC 2020


Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/util/virnetdevopenvswitch.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index bc6a130035..dbb489d174 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -485,7 +485,6 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
 {
     const char *tmpIfname = NULL;
     int status;
-    int ret = -1;
     g_autoptr(virCommand) cmd = NULL;
 
     /* Openvswitch vhostuser path are hardcoded to
@@ -495,10 +494,8 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
      * so we pick the filename and check it's a openvswitch interface
      */
     if (!path ||
-        !(tmpIfname = strrchr(path, '/'))) {
-        ret = 0;
-        goto cleanup;
-    }
+        !(tmpIfname = strrchr(path, '/')))
+        return 0;
 
     tmpIfname++;
     cmd = virCommandNew(OVSVSCTL);
@@ -507,15 +504,11 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path,
     if (virCommandRun(cmd, &status) < 0 ||
         status) {
         /* it's not a openvswitch vhostuser interface. */
-        ret = 0;
-        goto cleanup;
+        return 0;
     }
 
     *ifname = g_strdup(tmpIfname);
-    ret = 1;
-
- cleanup:
-    return ret;
+    return 1;
 }
 
 /**
-- 
2.26.2




More information about the libvir-list mailing list