[PATCH 26/30] util: remove cleanup labels

Ryan Gahagan rgahagan at cs.utexas.edu
Mon Nov 23 22:09:47 UTC 2020


From: Barrett Schonefeld <bschoney at utexas.edu>

- src/util/virscsihost.c

Signed-off-by: Barrett Schonefeld <bschoney at utexas.edu>
---
 src/util/virscsihost.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/util/virscsihost.c b/src/util/virscsihost.c
index 2ce33e4cfb..3aecb3146f 100644
--- a/src/util/virscsihost.c
+++ b/src/util/virscsihost.c
@@ -113,7 +113,7 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
         host_link = g_strdup_printf("%s/%s", prefix, entry->d_name);
 
         if (virFileResolveLink(host_link, &host_path) < 0)
-            goto cleanup;
+            return ret;
 
         if (!strstr(host_path, parentaddr)) {
             VIR_FREE(host_link);
@@ -131,13 +131,13 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
         }
 
         if (virFileReadAll(unique_path, 1024, &buf) < 0)
-            goto cleanup;
+            return ret;
 
         if ((p = strchr(buf, '\n')))
             *p = '\0';
 
         if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
-            goto cleanup;
+            return ret;
 
         VIR_FREE(buf);
 
@@ -150,7 +150,6 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
         break;
     }
 
- cleanup:
     return ret;
 }
 
@@ -231,10 +230,8 @@ virSCSIHostGetNameByParentaddr(unsigned int domain,
                        _("Failed to find scsi_host using PCI '%s' "
                          "and unique_id='%u'"),
                        parentaddr, unique_id);
-        goto cleanup;
     }
 
- cleanup:
     return name;
 }
 
-- 
2.29.0




More information about the libvir-list mailing list