[PATCH] virnuma: add notset NULL check in virNumaSetupMemoryPolicy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



introduce by commit c63ef0452b, when nodeset is NULL, validation
will pass in virNumaSetupMemoryPolicy, but virBitmapNextSetBit
must ensure bitmap is not Null. there will cause a segmentation
fault. this patch fixed it.

Signed-off-by: Chen Fan <chen.fan.fnst@xxxxxxxxxxxxxx>
---
 src/util/virnuma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virnuma.c b/src/util/virnuma.c
index 06520f7..b8d76f4 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;
 
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]