提交 2a5ea0a0 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 50f7483a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册