From cb78e64537ec58d0b5d35bca12b577cbe8c42ea6 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 14 Apr 2017 09:55:17 +0000 Subject: [PATCH] [HIDCLASS] Patch by Lesan Ilie: - Avoid over-allocating the DEVICE_RELATIONS structure in HidClassPDO_CreatePDO - Allocate device relations from paged pool CORE-13052 #resolve svn path=/trunk/; revision=74302 --- reactos/drivers/hid/hidclass/pdo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/hid/hidclass/pdo.c b/reactos/drivers/hid/hidclass/pdo.c index 92835a69a3a..761cb24d928 100644 --- a/reactos/drivers/hid/hidclass/pdo.c +++ b/reactos/drivers/hid/hidclass/pdo.c @@ -652,8 +652,8 @@ HidClassPDO_CreatePDO( // // first allocate device relations // - Length = sizeof(DEVICE_RELATIONS) + sizeof(PDEVICE_OBJECT) * FDODeviceExtension->Common.DeviceDescription.CollectionDescLength; - DeviceRelations = ExAllocatePoolWithTag(NonPagedPool, Length, HIDCLASS_TAG); + Length = FIELD_OFFSET(DEVICE_RELATIONS, Objects) + sizeof(PDEVICE_OBJECT) * FDODeviceExtension->Common.DeviceDescription.CollectionDescLength; + DeviceRelations = ExAllocatePoolWithTag(PagedPool, Length, HIDCLASS_TAG); if (!DeviceRelations) { // -- 2.17.1