提交 947593f6 编写于 作者: J John Ferlan

xen: Resolve Coverity NEGATIVE_RETURNS

Coverity notes that if the call to virBitmapParse() returns a negative
value, then when we jump to the error label, the call to
virCapabilitiesClearHostNUMACellCPUTopology() will have issues
with the negative nb_cpus
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 34476d72
......@@ -1112,7 +1112,8 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsPtr caps)
parse_error:
virReportError(VIR_ERR_XEN_CALL, "%s", _("topology syntax error"));
error:
virCapabilitiesClearHostNUMACellCPUTopology(cpuInfo, nb_cpus);
if (nb_cpus > 0)
virCapabilitiesClearHostNUMACellCPUTopology(cpuInfo, nb_cpus);
VIR_FREE(cpuInfo);
return -1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册