Re: [PATCH v1 05/21] lxc: remove unneeded cleanup labels

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

 



On Mon, Oct 21, 2019 at 03:18:55PM -0300, Daniel Henrique Barboza wrote:
Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---
src/lxc/lxc_cgroup.c     | 70 ++++++++++++++++------------------------
src/lxc/lxc_container.c  | 17 ++++------
src/lxc/lxc_controller.c | 44 +++++++++++--------------
src/lxc/lxc_driver.c     | 39 +++++++++-------------
src/lxc/lxc_process.c    | 34 ++++++++-----------
5 files changed, 81 insertions(+), 123 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 41a6a446bd..5caef1a472 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3440,7 +3440,7 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
    case VIR_DOMAIN_DEVICE_NET:
        net = dev->data.net;
        if (virDomainNetInsert(vmdef, net) < 0)
-            goto cleanup;
+            return ret;

This should be return -1;

        dev->data.net = NULL;
        ret = 0;
        break;
@@ -3464,7 +3464,6 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef,
         break;
    }

- cleanup:
    return ret;
}

@@ -3482,7 +3481,7 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
    case VIR_DOMAIN_DEVICE_NET:
        net = dev->data.net;
        if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
-            goto cleanup;
+            return -1;

        oldDev.data.net = vmdef->nets[idx];
        if (virDomainDefCompatibleDevice(vmdef, dev, &oldDev,
@@ -3505,7 +3504,6 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
        break;
    }

- cleanup:
    return ret;
}

@@ -3535,7 +3533,7 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef,
    case VIR_DOMAIN_DEVICE_NET:
        net = dev->data.net;
        if ((idx = virDomainNetFindIdx(vmdef, net)) < 0)
-            goto cleanup;
+            return ret;

Same here.


        /* this is guaranteed to succeed */
        virDomainNetDefFree(virDomainNetRemove(vmdef, idx));

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux