summaryrefslogtreecommitdiff
path: root/EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c')
-rw-r--r--EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c35
1 files changed, 12 insertions, 23 deletions
diff --git a/EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c b/EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
index 1e2b370..b0e1c2b 100644
--- a/EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
+++ b/EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.c
@@ -136,18 +136,11 @@ AllocateMemory (
IN UINTN Size
)
{
- EFI_STATUS Status;
VOID *Buffer;
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- Size,
- (VOID *)&Buffer
- );
- if (EFI_ERROR (Status)) {
- ASSERT (FALSE);
- return NULL;
- }
+ Buffer = AllocatePool (Size);
+ ASSERT (Buffer != NULL);
+
return Buffer;
}
@@ -341,13 +334,9 @@ Returns:
}
if (Status != EFI_ALREADY_STARTED) {
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (WIN_NT_BUS_DEVICE),
- (VOID *) &WinNtBusDevice
- );
- if (EFI_ERROR (Status)) {
- return Status;
+ WinNtBusDevice = AllocatePool (sizeof (WIN_NT_BUS_DEVICE));
+ if (WinNtBusDevice == NULL) {
+ return EFI_OUT_OF_RESOURCES;
}
WinNtBusDevice->Signature = WIN_NT_BUS_DEVICE_SIGNATURE;
@@ -368,7 +357,7 @@ Returns:
);
if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
- gBS->FreePool (WinNtBusDevice);
+ FreePool (WinNtBusDevice);
return Status;
}
}
@@ -464,7 +453,7 @@ Returns:
Count
);
if (WinNtDevice->DevicePath == NULL) {
- gBS->FreePool (WinNtDevice);
+ FreePool (WinNtDevice);
return EFI_OUT_OF_RESOURCES;
}
@@ -490,7 +479,7 @@ Returns:
);
if (EFI_ERROR (Status)) {
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
- gBS->FreePool (WinNtDevice);
+ FreePool (WinNtDevice);
} else {
//
// Open For Child Device
@@ -516,7 +505,7 @@ Returns:
StartString = SubString;
}
- gBS->FreePool (TempStr);
+ FreePool (TempStr);
}
return EFI_SUCCESS;
@@ -588,7 +577,7 @@ Returns:
FreeUnicodeStringTable (WinNtBusDevice->ControllerNameTable);
- gBS->FreePool (WinNtBusDevice);
+ FreePool (WinNtBusDevice);
gBS->CloseProtocol (
ControllerHandle,
@@ -652,7 +641,7 @@ Returns:
// Close the child handle
//
FreeUnicodeStringTable (WinNtDevice->ControllerNameTable);
- gBS->FreePool (WinNtDevice);
+ FreePool (WinNtDevice);
}
}