[PATCH 27/32] lxc: eliminate unnecessary labels

Laine Stump posted 32 patches 5 years, 7 months ago
[PATCH 27/32] lxc: eliminate unnecessary labels
Posted by Laine Stump 5 years, 7 months ago
Signed-off-by: Laine Stump <laine@redhat.com>
---
 src/lxc/lxc_controller.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 01cdeb29db..ae6b737b60 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1380,13 +1380,12 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
 {
     g_auto(virBuffer) map_value = VIR_BUFFER_INITIALIZER;
     size_t i;
-    int ret = -1;
 
     /* The kernel supports up to 340 lines in /proc/<pid>/{g,u}id_map */
     if (num > 340) {
         virReportError(VIR_ERR_INVALID_ARG, "%s",
                        _("Too many id mappings defined."));
-        goto cleanup;
+        return -1;
     }
 
     for (i = 0; i < num; i++)
@@ -1397,12 +1396,10 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
 
     if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
         virReportSystemError(errno, _("unable write to %s"), path);
-        goto cleanup;
+        return -1;
     }
 
-    ret = 0;
- cleanup:
-    return ret;
+    return 0;
 }
 
 /**
-- 
2.25.4

Re: [PATCH 27/32] lxc: eliminate unnecessary labels
Posted by Ján Tomko 5 years, 7 months ago
On a Sunday in 2020, Laine Stump wrote:
>Signed-off-by: Laine Stump <laine@redhat.com>
>---
> src/lxc/lxc_controller.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano