qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 30/59] util/module.c: remove unneeded label in module_load_fil


From: Daniel Henrique Barboza
Subject: [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file()
Date: Mon, 6 Jan 2020 15:23:56 -0300

'out' can be replaced by the apropriate return values set
in 'ret' for each case.

CC: Paolo Bonzini <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 util/module.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/util/module.c b/util/module.c
index e9fe3e5422..9b5453f878 100644
--- a/util/module.c
+++ b/util/module.c
@@ -111,12 +111,10 @@ static int module_load_file(const char *fname)
 
     if (len <= suf_len || strcmp(&fname[len - suf_len], dsosuf)) {
         /* wrong suffix */
-        ret = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
     if (access(fname, F_OK)) {
-        ret = -ENOENT;
-        goto out;
+        return -ENOENT;
     }
 
     assert(QTAILQ_EMPTY(&dso_init_list));
@@ -125,8 +123,7 @@ static int module_load_file(const char *fname)
     if (!g_module) {
         fprintf(stderr, "Failed to open module: %s\n",
                 g_module_error());
-        ret = -EINVAL;
-        goto out;
+        return -EINVAL;
     }
     if (!g_module_symbol(g_module, DSO_STAMP_FUN_STR, (gpointer *)&sym)) {
         fprintf(stderr, "Failed to initialize module: %s\n",
@@ -151,7 +148,7 @@ static int module_load_file(const char *fname)
         QTAILQ_REMOVE(&dso_init_list, e, node);
         g_free(e);
     }
-out:
+
     return ret;
 }
 #endif
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]