mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
conf: Fix error path in virNodeDevPCICapabilityParseXML
If the call to virXPathNodeSet to set naddresses fails, Coverity notes that the subsequent VIR_ALLOC_N cannot have a negative value (well it probably wouldn't be negative per se). Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
70e9114e7c
commit
9d418b20ae
@ -1305,7 +1305,10 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt,
|
|||||||
data->pci_dev.physical_function) < 0)
|
data->pci_dev.physical_function) < 0)
|
||||||
goto out;
|
goto out;
|
||||||
} else if (STREQ(type, "virt_functions")) {
|
} else if (STREQ(type, "virt_functions")) {
|
||||||
int naddresses = virXPathNodeSet("./address", ctxt, &addresses);
|
int naddresses;
|
||||||
|
|
||||||
|
if ((naddresses = virXPathNodeSet("./address", ctxt, &addresses)) < 0)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (maxFuncsStr &&
|
if (maxFuncsStr &&
|
||||||
virStrToLong_uip(maxFuncsStr, NULL, 10,
|
virStrToLong_uip(maxFuncsStr, NULL, 10,
|
||||||
|
Loading…
Reference in New Issue
Block a user