From fc313364b19be6a3662d5301e195b898d6662087 Mon Sep 17 00:00:00 2001 From: Chen Fan Date: Fri, 7 Nov 2014 16:54:56 +0800 Subject: [PATCH] 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 --- src/util/virnuma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 06520f78eb..b8d76f4074 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -97,6 +97,9 @@ virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode, size_t i; int maxnode = 0; + if (!nodeset) + return 0; + if (!virNumaNodesetIsAvailable(nodeset)) return -1; -- GitLab