]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
Size XENBUS_CACHE Magazine array to maximum processor count
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 9 Dec 2015 14:15:35 +0000 (14:15 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Wed, 9 Dec 2015 14:15:35 +0000 (14:15 +0000)
Sizing to active processor count means that the array will be too small if
a processor is onlined after cache creation.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/cache.c

index 9727b14db9ded79cdf60cdc1a82c9f9a3d029d0c..5a144114db8c39c82b771d8feac6bc71fb33778e 100644 (file)
@@ -617,7 +617,7 @@ CacheCreate(
     if (!NT_SUCCESS(status))
         goto fail4;
 
-    (*Cache)->MagazineCount = KeQueryActiveProcessorCountEx(ALL_PROCESSOR_GROUPS);
+    (*Cache)->MagazineCount = KeQueryMaximumProcessorCountEx(ALL_PROCESSOR_GROUPS);
     (*Cache)->Magazine = __CacheAllocate(sizeof (XENBUS_CACHE_MAGAZINE) * (*Cache)->MagazineCount);
 
     status = STATUS_NO_MEMORY;