[libvirt PATCH 04/11] interface_backend_udev: refactor udevListInterfacesByStatus

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

 



Commit <2f3b7a5555c4cf4127ff3f8e00746eafcc91432c> replaced VIR_STRDUP
by g_strdup which made the error: path mostly useless.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/interface/interface_backend_udev.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 4e0a80765c..ce007fd29e 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -204,7 +204,8 @@ udevListInterfacesByStatus(virConnectPtr conn,
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("failed to get list of %s interfaces on host"),
                        virUdevStatusString(status));
-        goto error;
+        udev_unref(udev);
+        return -1;
     }
 
     /* Do the scan to load up the enumeration */
@@ -239,16 +240,6 @@ udevListInterfacesByStatus(virConnectPtr conn,
     udev_unref(udev);
 
     return count;
-
- error:
-    if (enumerate)
-        udev_enumerate_unref(enumerate);
-    udev_unref(udev);
-
-    for (names_len = 0; names_len < count; names_len++)
-        VIR_FREE(names[names_len]);
-
-    return -1;
 }
 
 static int
-- 
2.26.2




[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