[PATCH 02/10] conf: domain: Remove checking of return value of virHashCreateFull

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

 



This module has last two direct checks whether the value returned by
virHashCreateFull is NULL. Remove them so that static analyzers don't
get the false idea that checking the value is necessary.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_addr.c | 32 +++++++++++++-------------------
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index 607ba56efd..f07b3d9725 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -1044,28 +1044,22 @@ virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
         if (VIR_ALLOC(addrs->zpciIds) < 0)
             return -1;

-        if (!(addrs->zpciIds->uids = virHashCreateFull(10, NULL,
-                                                       virZPCIAddrKeyCode,
-                                                       virZPCIAddrKeyEqual,
-                                                       virZPCIAddrKeyCopy,
-                                                       virZPCIAddrKeyPrintHuman,
-                                                       virZPCIAddrKeyFree)))
-            goto error;
-
-        if (!(addrs->zpciIds->fids = virHashCreateFull(10, NULL,
-                                                       virZPCIAddrKeyCode,
-                                                       virZPCIAddrKeyEqual,
-                                                       virZPCIAddrKeyCopy,
-                                                       virZPCIAddrKeyPrintHuman,
-                                                       virZPCIAddrKeyFree)))
-            goto error;
+        addrs->zpciIds->uids = virHashCreateFull(10, NULL,
+                                                 virZPCIAddrKeyCode,
+                                                 virZPCIAddrKeyEqual,
+                                                 virZPCIAddrKeyCopy,
+                                                 virZPCIAddrKeyPrintHuman,
+                                                 virZPCIAddrKeyFree);
+
+        addrs->zpciIds->fids = virHashCreateFull(10, NULL,
+                                                 virZPCIAddrKeyCode,
+                                                 virZPCIAddrKeyEqual,
+                                                 virZPCIAddrKeyCopy,
+                                                 virZPCIAddrKeyPrintHuman,
+                                                 virZPCIAddrKeyFree);
     }

     return 0;
-
- error:
-    virDomainPCIAddressSetExtensionFree(addrs);
-    return -1;
 }


-- 
2.24.1





[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