]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetDevOpenvswitchGetVhostuserIfname: Drop cleanup label
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 13 May 2020 09:49:37 +0000 (11:49 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 13 May 2020 11:14:29 +0000 (13:14 +0200)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdevopenvswitch.c

index bc6a1300350c352d82c8b1372c7c883c852b96a2..dbb489d174daeb44d9d930c5ef0d28a5633853be 100644 (file)
@@ -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;
 }
 
 /**