提交 609acf1f 编写于 作者: M Michal Privoznik

cpu.c: Check properly for virCapabilitiesGetNodeInfo() retval

The virCapabilitiesGetNodeInfo() function has the usual return
value semantics for integeres: a negative value means an error,
zero or a positive value means success. However, the function
call done in virCPUProbeHost() doesn't check for the return value
accordingly.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 29d43bf9
......@@ -456,7 +456,7 @@ virCPUProbeHost(virArch arch)
{
virNodeInfo nodeinfo;
if (virCapabilitiesGetNodeInfo(&nodeinfo))
if (virCapabilitiesGetNodeInfo(&nodeinfo) < 0)
return NULL;
return virCPUGetHost(arch, VIR_CPU_TYPE_HOST, &nodeinfo, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册