[PATCH 05/32] Do not call nodeStateCleanup on early initialization error

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

 



If we have not allocated driver yet, there is nothing to cleanup.
---
 src/node_device/node_device_udev.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 1e11afe..c2f503d 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1709,21 +1709,21 @@ static int nodeStateInitialize(bool privileged,
     int ret = -1;
 
     if (VIR_ALLOC(priv) < 0)
-        goto out;
+        return -1;
 
     priv->watch = -1;
     priv->privileged = privileged;
 
     if (VIR_ALLOC(driver) < 0) {
         VIR_FREE(priv);
-        goto out;
+        return -1;
     }
 
     if (virMutexInit(&driver->lock) < 0) {
         VIR_ERROR(_("Failed to initialize mutex for driver"));
         VIR_FREE(priv);
         VIR_FREE(driver);
-        goto out;
+        return -1;
     }
 
     nodeDeviceLock();
@@ -1785,7 +1785,6 @@ static int nodeStateInitialize(bool privileged,
  out_unlock:
     nodeDeviceUnlock();
 
- out:
     if (ret == -1)
         nodeStateCleanup();
     return ret;
-- 
2.7.3

--
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]