]> xenbits.xensource.com Git - pvdrivers/win/xenvbd.git/commitdiff
Calculate size of DEVICE_RELATIONS
authorOwen Smith <owen.smith@citrix.com>
Thu, 11 Jun 2015 11:30:29 +0000 (12:30 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Fri, 12 Jun 2015 08:23:14 +0000 (09:23 +0100)
Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xendisk/fdo.c

index 154400f4830ff0d08c70ee4cfe01b0eb57b383d1..e261b7ac06dd3b7d958d750216e41d4b465d8a13 100644 (file)
@@ -885,7 +885,7 @@ FdoQueryDeviceRelations(
          ListEntry = ListEntry->Flink)
         Count++;
 
-    Size = FIELD_OFFSET(DEVICE_RELATIONS, Objects) + (sizeof (DEVICE_OBJECT) * __min(Count, 1));
+    Size = sizeof(DEVICE_RELATIONS) + (sizeof (PDEVICE_OBJECT) * Count);
 
     Relations = ExAllocatePoolWithTag(PagedPool, Size, 'TLIF');