mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-27 18:03:50 +03:00
nodeinfo: Resolve Coverity NEGATIVE_RETURNS
If the virNumaGetNodeCPUs() call fails with -1, then jumping to cleanup with 'cpus == NULL' and calling virCapabilitiesClearHostNUMACellCPUTopology will cause issues. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
35a50ea8c7
commit
34476d720f
@ -1933,17 +1933,13 @@ nodeCapsInitNUMA(virCapsPtr caps)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
if (topology_failed || ret < 0)
|
||||
if ((topology_failed || ret < 0) && cpus)
|
||||
virCapabilitiesClearHostNUMACellCPUTopology(cpus, ncpus);
|
||||
|
||||
virBitmapFree(cpumap);
|
||||
VIR_FREE(cpus);
|
||||
VIR_FREE(siblings);
|
||||
VIR_FREE(pageinfo);
|
||||
|
||||
if (ret < 0)
|
||||
VIR_FREE(cpus);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user