From: Peter Krempa Date: Tue, 28 Jan 2020 12:40:24 +0000 (+0100) Subject: conf: domain: Remove checking of return value of virHashCreateFull X-Git-Tag: v6.1.0-rc1~302 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a5ea0a0c1843c7c43e673b3d2082cc3abdef602;p=thirdparty%2Flibvirt.git conf: domain: Remove checking of return value of virHashCreateFull 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 Reviewed-by: Michal Privoznik --- 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; - - 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; }