conf: virNodeDeviceCapVPDParse*: Remove pointless NULL checks

The function are never called with NULL argument so the checks can be
removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-01-24 16:27:35 +01:00
parent d36da8ea4a
commit fb69acf5c2
1 changed files with 0 additions and 6 deletions

View File

@ -1023,9 +1023,6 @@ virNodeDeviceCapVPDParseReadOnlyFields(xmlXPathContextPtr ctxt, virPCIVPDResourc
"serial_number", "part_number", NULL};
size_t i = 0;
if (res == NULL)
return -1;
res->ro = virPCIVPDResourceRONew();
while (keywords[i]) {
@ -1061,9 +1058,6 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
size_t i = 0;
g_autoptr(virPCIVPDResource) newres = g_new0(virPCIVPDResource, 1);
if (res == NULL)
return -1;
if (!(newres->name = virXPathString("string(./name)", ctxt))) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("Could not read a device name from the <name> element"));