mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[FREELDR]
- Add missing checks for allocation failure in DetectSerialPointerPeripheral and DetectPS2Mouse. Patch by Serge Gautherie. CORE-12623 svn path=/trunk/; revision=73608
This commit is contained in:
@@ -1037,6 +1037,11 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey,
|
||||
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
|
||||
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
||||
PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
|
||||
if (PartialResourceList == NULL)
|
||||
{
|
||||
ERR("Failed to allocate resource descriptor\n");
|
||||
return;
|
||||
}
|
||||
memset(PartialResourceList, 0, Size);
|
||||
PartialResourceList->Version = 1;
|
||||
PartialResourceList->Revision = 1;
|
||||
@@ -1577,6 +1582,11 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||
TRACE("Detected PS2 port\n");
|
||||
|
||||
PartialResourceList = FrLdrHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST), TAG_HW_RESOURCE_LIST);
|
||||
if (PartialResourceList == NULL)
|
||||
{
|
||||
ERR("Failed to allocate resource descriptor\n");
|
||||
return;
|
||||
}
|
||||
memset(PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
|
||||
|
||||
/* Initialize resource descriptor */
|
||||
@@ -1613,6 +1623,11 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
|
||||
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
|
||||
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
|
||||
PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
|
||||
if (PartialResourceList == NULL)
|
||||
{
|
||||
ERR("Failed to allocate resource descriptor\n");
|
||||
return;
|
||||
}
|
||||
memset(PartialResourceList, 0, Size);
|
||||
PartialResourceList->Version = 1;
|
||||
PartialResourceList->Revision = 1;
|
||||
|
||||
Reference in New Issue
Block a user