mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 17:34:18 +03:00
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: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
29d43bf96a
commit
609acf1f5d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user