mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00: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:
parent
6cc9855127
commit
fc313364b1
@ -97,6 +97,9 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode,
|
||||
size_t i;
|
||||
int maxnode = 0;
|
||||
|
||||
if (!nodeset)
|
||||
return 0;
|
||||
|
||||
if (!virNumaNodesetIsAvailable(nodeset))
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user