1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-13 17:18:01 +03:00

virnuma: add nodeset NULL check in virNumaSetupMemoryPolicy

Introduced by commit c63ef0452b, when nodeset is NULL, validation will
pass in virNumaSetupMemoryPolicy, but virBitmapNextSetBit must ensure
bitmap is not NULL, otherwise that might cause a segmentation fault.
This patch fixes it.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
This commit is contained in:
Chen Fan 2014-11-07 16:54:56 +08:00 committed by Martin Kletzander
parent 6cc9855127
commit fc313364b1

View File

@ -97,6 +97,9 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
size_t i;
int maxnode = 0;
if (!nodeset)
return 0;
if (!virNumaNodesetIsAvailable(nodeset))
return -1;