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

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