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

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