summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-16 02:33:49 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2007-03-16 02:33:49 +0000
commit6626ad113ee5420201ea7c1f173f718978295eed (patch)
treedb5cc69ea9eeae6f7c508204cc30a4e17aa522bd /EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
parent8f6b43f235c6ffc2db391ea62d124f88d1e610ba (diff)
downloadedk2-6626ad113ee5420201ea7c1f173f718978295eed.zip
edk2-6626ad113ee5420201ea7c1f173f718978295eed.tar.gz
edk2-6626ad113ee5420201ea7c1f173f718978295eed.tar.bz2
Perfect the msa of the following modules, DiskIo, Partition, English and Ebc.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2480 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c')
-rw-r--r--EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c58
1 files changed, 23 insertions, 35 deletions
diff --git a/EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c b/EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
index cf68329..52f8d9f 100644
--- a/EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
+++ b/EdkModulePkg/Universal/Ebc/Dxe/EbcInt.c
@@ -222,12 +222,9 @@ Returns:
//
// Allocate memory for our protocol. Then fill in the blanks.
//
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (EFI_EBC_PROTOCOL),
- (VOID **) &EbcProtocol
- );
- if (Status != EFI_SUCCESS) {
+ EbcProtocol = AllocatePool (sizeof (EFI_EBC_PROTOCOL));
+
+ if (EbcProtocol == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -273,7 +270,7 @@ Returns:
}
if (HandleBuffer != NULL) {
- gBS->FreePool (HandleBuffer);
+ FreePool (HandleBuffer);
HandleBuffer = NULL;
}
//
@@ -287,19 +284,16 @@ Returns:
EbcProtocol
);
if (EFI_ERROR (Status)) {
- gBS->FreePool (EbcProtocol);
+ FreePool (EbcProtocol);
return Status;
}
}
//
// Allocate memory for our debug protocol. Then fill in the blanks.
//
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (EFI_DEBUG_SUPPORT_PROTOCOL),
- (VOID **) &EbcDebugProtocol
- );
- if (Status != EFI_SUCCESS) {
+ EbcDebugProtocol = AllocatePool (sizeof (EFI_DEBUG_SUPPORT_PROTOCOL));
+
+ if (EbcDebugProtocol == NULL) {
goto ErrorExit;
}
@@ -322,7 +316,7 @@ Returns:
// This is recoverable, so free the memory and continue.
//
if (EFI_ERROR (Status)) {
- gBS->FreePool (EbcDebugProtocol);
+ FreePool (EbcDebugProtocol);
goto ErrorExit;
}
//
@@ -370,11 +364,11 @@ ErrorExit:
}
if (HandleBuffer != NULL) {
- gBS->FreePool (HandleBuffer);
+ FreePool (HandleBuffer);
HandleBuffer = NULL;
}
- gBS->FreePool (EbcProtocol);
+ FreePool (EbcProtocol);
return Status;
}
@@ -894,8 +888,8 @@ Returns:
ThunkList = ImageList->ThunkList;
while (ThunkList != NULL) {
NextThunkList = ThunkList->Next;
- gBS->FreePool (ThunkList->ThunkBuffer);
- gBS->FreePool (ThunkList);
+ FreePool (ThunkList->ThunkBuffer);
+ FreePool (ThunkList);
ThunkList = NextThunkList;
}
//
@@ -912,7 +906,7 @@ Returns:
//
// Now free up the image list element
//
- gBS->FreePool (ImageList);
+ FreePool (ImageList);
return EFI_SUCCESS;
}
@@ -970,12 +964,9 @@ Returns:
//
// Allocate a new one
//
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (EBC_IMAGE_LIST),
- (VOID **) &ImageList
- );
- if (Status != EFI_SUCCESS) {
+ ImageList = AllocatePool (sizeof (EBC_IMAGE_LIST));
+
+ if (ImageList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@@ -987,12 +978,9 @@ Returns:
//
// Ok, now create a new thunk element to add to the list
//
- Status = gBS->AllocatePool (
- EfiBootServicesData,
- sizeof (EBC_THUNK_LIST),
- (VOID **) &ThunkList
- );
- if (Status != EFI_SUCCESS) {
+ ThunkList = AllocatePool (sizeof (EBC_THUNK_LIST));
+
+ if (ThunkList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
//
@@ -1061,8 +1049,8 @@ Returns:
//
// Allocate memory for the protocol, then fill in the fields
//
- Status = gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_EBC_VM_TEST_PROTOCOL), (VOID **) &EbcVmTestProtocol);
- if (Status != EFI_SUCCESS) {
+ EbcVmTestProtocol = AllocatePool (sizeof (EFI_EBC_VM_TEST_PROTOCOL));
+ if (EbcVmTestProtocol == NULL) {
return EFI_OUT_OF_RESOURCES;
}
EbcVmTestProtocol->Execute = (EBC_VM_TEST_EXECUTE) EbcExecuteInstructions;
@@ -1078,7 +1066,7 @@ Returns:
Handle = NULL;
Status = gBS->InstallProtocolInterface (&Handle, &mEfiEbcVmTestProtocolGuid, EFI_NATIVE_INTERFACE, EbcVmTestProtocol);
if (EFI_ERROR (Status)) {
- gBS->FreePool (EbcVmTestProtocol);
+ FreePool (EbcVmTestProtocol);
}
return Status;
}