Blame SOURCES/libvirt-conf-domain-Remove-checking-of-return-value-of-virHashCreateFull.patch

d76c62
From 04792aa0715be4e779fca81fa8f7e9f2c5c1b71f Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <04792aa0715be4e779fca81fa8f7e9f2c5c1b71f@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Tue, 4 Feb 2020 15:08:00 +0100
d76c62
Subject: [PATCH] conf: domain: Remove checking of return value of
d76c62
 virHashCreateFull
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
This module has last two direct checks whether the value returned by
d76c62
virHashCreateFull is NULL. Remove them so that static analyzers don't
d76c62
get the false idea that checking the value is necessary.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
d76c62
(cherry picked from commit 2a5ea0a0c1843c7c43e673b3d2082cc3abdef602)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1793263
d76c62
Message-Id: <2e310ad44b341511caba735608bc0bba4b072d6c.1580824112.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/conf/domain_addr.c | 30 ++++++++++++------------------
d76c62
 1 file changed, 12 insertions(+), 18 deletions(-)
d76c62
d76c62
diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
d76c62
index 607ba56efd..f07b3d9725 100644
d76c62
--- a/src/conf/domain_addr.c
d76c62
+++ b/src/conf/domain_addr.c
d76c62
@@ -1044,28 +1044,22 @@ virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs,
d76c62
         if (VIR_ALLOC(addrs->zpciIds) < 0)
d76c62
             return -1;
d76c62
 
d76c62
-        if (!(addrs->zpciIds->uids = virHashCreateFull(10, NULL,
d76c62
-                                                       virZPCIAddrKeyCode,
d76c62
-                                                       virZPCIAddrKeyEqual,
d76c62
-                                                       virZPCIAddrKeyCopy,
d76c62
-                                                       virZPCIAddrKeyPrintHuman,
d76c62
-                                                       virZPCIAddrKeyFree)))
d76c62
-            goto error;
d76c62
+        addrs->zpciIds->uids = virHashCreateFull(10, NULL,
d76c62
+                                                 virZPCIAddrKeyCode,
d76c62
+                                                 virZPCIAddrKeyEqual,
d76c62
+                                                 virZPCIAddrKeyCopy,
d76c62
+                                                 virZPCIAddrKeyPrintHuman,
d76c62
+                                                 virZPCIAddrKeyFree);
d76c62
 
d76c62
-        if (!(addrs->zpciIds->fids = virHashCreateFull(10, NULL,
d76c62
-                                                       virZPCIAddrKeyCode,
d76c62
-                                                       virZPCIAddrKeyEqual,
d76c62
-                                                       virZPCIAddrKeyCopy,
d76c62
-                                                       virZPCIAddrKeyPrintHuman,
d76c62
-                                                       virZPCIAddrKeyFree)))
d76c62
-            goto error;
d76c62
+        addrs->zpciIds->fids = virHashCreateFull(10, NULL,
d76c62
+                                                 virZPCIAddrKeyCode,
d76c62
+                                                 virZPCIAddrKeyEqual,
d76c62
+                                                 virZPCIAddrKeyCopy,
d76c62
+                                                 virZPCIAddrKeyPrintHuman,
d76c62
+                                                 virZPCIAddrKeyFree);
d76c62
     }
d76c62
 
d76c62
     return 0;
d76c62
-
d76c62
- error:
d76c62
-    virDomainPCIAddressSetExtensionFree(addrs);
d76c62
-    return -1;
d76c62
 }
d76c62
 
d76c62
 
d76c62
-- 
d76c62
2.25.0
d76c62