libvirt/SOURCES/libvirt-conf-domain-Remove-...

74 lines
3.2 KiB
Diff

From 04792aa0715be4e779fca81fa8f7e9f2c5c1b71f Mon Sep 17 00:00:00 2001
Message-Id: <04792aa0715be4e779fca81fa8f7e9f2c5c1b71f@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Tue, 4 Feb 2020 15:08:00 +0100
Subject: [PATCH] conf: domain: Remove checking of return value of
virHashCreateFull
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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>
(cherry picked from commit 2a5ea0a0c1843c7c43e673b3d2082cc3abdef602)
https://bugzilla.redhat.com/show_bug.cgi?id=1793263
Message-Id: <2e310ad44b341511caba735608bc0bba4b072d6c.1580824112.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/conf/domain_addr.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 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;
+ addrs->zpciIds->uids = virHashCreateFull(10, NULL,
+ virZPCIAddrKeyCode,
+ virZPCIAddrKeyEqual,
+ virZPCIAddrKeyCopy,
+ virZPCIAddrKeyPrintHuman,
+ virZPCIAddrKeyFree);
- if (!(addrs->zpciIds->fids = virHashCreateFull(10, NULL,
- virZPCIAddrKeyCode,
- virZPCIAddrKeyEqual,
- virZPCIAddrKeyCopy,
- virZPCIAddrKeyPrintHuman,
- virZPCIAddrKeyFree)))
- goto error;
+ addrs->zpciIds->fids = virHashCreateFull(10, NULL,
+ virZPCIAddrKeyCode,
+ virZPCIAddrKeyEqual,
+ virZPCIAddrKeyCopy,
+ virZPCIAddrKeyPrintHuman,
+ virZPCIAddrKeyFree);
}
return 0;
-
- error:
- virDomainPCIAddressSetExtensionFree(addrs);
- return -1;
}
--
2.25.0