提交 34476d72 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 35a50ea8
...@@ -1933,17 +1933,13 @@ nodeCapsInitNUMA(virCapsPtr caps) ...@@ -1933,17 +1933,13 @@ nodeCapsInitNUMA(virCapsPtr caps)
ret = 0; ret = 0;
cleanup: cleanup:
if (topology_failed || ret < 0) if ((topology_failed || ret < 0) && cpus)
virCapabilitiesClearHostNUMACellCPUTopology(cpus, ncpus); virCapabilitiesClearHostNUMACellCPUTopology(cpus, ncpus);
virBitmapFree(cpumap); virBitmapFree(cpumap);
VIR_FREE(cpus); VIR_FREE(cpus);
VIR_FREE(siblings); VIR_FREE(siblings);
VIR_FREE(pageinfo); VIR_FREE(pageinfo);
if (ret < 0)
VIR_FREE(cpus);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册