]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: domain: Remove checking of return value of virHashCreateFull
authorPeter Krempa <pkrempa@redhat.com>
Tue, 28 Jan 2020 12:40:24 +0000 (13:40 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 31 Jan 2020 13:28:28 +0000 (14:28 +0100)
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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_addr.c

index 607ba56efdc1a4f1dc1935425e159ed7fdfd42fb..f07b3d9725b6f2cd11360cd2de4f8bdb23699beb 100644 (file)
@@ -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;
 }