This commit is contained in:
jief 2020-04-28 22:31:05 +03:00
commit e26fe8ba0c
307 changed files with 1123 additions and 1107 deletions

View File

@ -1334,6 +1334,13 @@ final class SettingsViewController:
self.downloadTask?.resume()
}
func cleanUpdateDirectory() {
let tempDir = "/tmp/CloverXXXXX\(NSUserName())Update"
if fm.fileExists(atPath: tempDir) {
try? fm.removeItem(atPath: tempDir)
}
}
func urlSession(_ session: URLSession,
downloadTask: URLSessionDownloadTask,
didFinishDownloadingTo location: URL) {
@ -1385,6 +1392,8 @@ final class SettingsViewController:
task.terminationHandler = { t in
if t.terminationStatus == 0 {
self.replaceCloverV2(with: tempDir.addPath("CloverV2"))
} else {
self.cleanUpdateDirectory()
}
}
@ -1408,6 +1417,7 @@ final class SettingsViewController:
}
if (error != nil) {
print(error!.localizedDescription)
self.cleanUpdateDirectory()
}
}
@ -1459,6 +1469,8 @@ final class SettingsViewController:
try fm.removeItem(atPath: Cloverv2Path)
}
try fm.copyItem(atPath: newOne, toPath: Cloverv2Path)
self.cleanUpdateDirectory()
DispatchQueue.main.async {
self.lastReleaseRev = nil
self.lastReleaseLink = nil
@ -1486,6 +1498,7 @@ final class SettingsViewController:
}
try fm.createDirectory(atPath: new, withIntermediateDirectories: false, attributes: nil)
try fm.copyItem(atPath: path, toPath: new.addPath(path.lastPath))
self.cleanUpdateDirectory()
DispatchQueue.main.async {
self.lastReleaseRev = nil
self.lastReleaseLink = nil

View File

@ -31,7 +31,7 @@ final class Installer: NSObject {
} else {
t.launchPath = "/bin/bash"
}
t.arguments = ["-c", "rm -f /tmp/Clover* && rm -f /tmp/boot0* && rm -f /tmp/boot1*"]
t.arguments = ["-c", "rm -rf /tmp/Clover* && rm -f /tmp/boot0* && rm -f /tmp/boot1*"]
t.launch()
}
@ -286,7 +286,7 @@ final class Installer: NSObject {
self.log("sleeping 6 seconds..")
sleep(6)
if !fm.isWritableFile(atPath: targetVol) {
exit("Error: target volume \"\(targetVol)\" is not writable.")
exit("Error: target volume \"\(targetVol)\" is not writable (may be running from a Virtual Machine??).")
} else {
self.log("'\(targetVol)' is now read/write.")
}

View File

@ -8,7 +8,7 @@
import Foundation
let daemonVersion = "1.1.2"
let daemonVersion = "1.1.3"
let fm = FileManager.default

View File

@ -323,7 +323,7 @@ BiosKeyboardDriverBindingStart (
//
// Allocate the private device structure
//
BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_DEV));
BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_DEV));
if (NULL == BiosKeyboardPrivate) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -2699,7 +2699,7 @@ BiosKeyboardRegisterKeyNotify (
// Allocate resource to save the notification function
//
NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
if (NewNotify == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;

View File

@ -281,7 +281,7 @@ InitializeGraphicsConsoleTextMode (
// and does not include the invalid modes which exceed the max column and row.
// Reserve 2 modes for 80x25, 80x50 of graphics console.
//
NewModeBuffer = AllocateZeroPool (sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2));
NewModeBuffer = AllocateZeroPool(sizeof (GRAPHICS_CONSOLE_MODE_DATA) * (Count + 2));
if (!NewModeBuffer) {
return EFI_OUT_OF_RESOURCES;
}
@ -1783,7 +1783,7 @@ DrawUnicodeWeightAtCursorN (
UINTN RowInfoArraySize;
Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool(sizeof (EFI_IMAGE_OUTPUT));
if (Blt == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -1801,7 +1801,7 @@ DrawUnicodeWeightAtCursorN (
//
*(String + Count) = L'\0';
FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool(sizeof (EFI_FONT_DISPLAY_INFO));
if (FontInfo == NULL) {
FreePool(Blt);
FreePool(String);
@ -1840,7 +1840,7 @@ DrawUnicodeWeightAtCursorN (
UgaDraw = Private->UgaDraw;
Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
Blt->Image.Bitmap = AllocateZeroPool(Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
if (Blt->Image.Bitmap == NULL) {
FreePool(Blt);
FreePool(String);
@ -2074,7 +2074,7 @@ RegisterFontPackage (
// +--------------------------------+
PackageLength = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + mNarrowFontSize + 4;
Package = AllocateZeroPool (PackageLength);
Package = AllocateZeroPool(PackageLength);
// ASSERT (Package != NULL);
if (!Package) {
return;

View File

@ -505,7 +505,7 @@ AcpiPlatformEntryPoint (
EFI_FILE_SYSTEM_INFO **mFsInfo = NULL;
gBS->LocateHandleBuffer (ByProtocol, &gEfiSimpleFileSystemProtocolGuid, NULL, &mFsCount, &mFs);
mFsInfo = AllocateZeroPool (mFsCount * sizeof (EFI_FILE_SYSTEM_INFO *));
mFsInfo = AllocateZeroPool(mFsCount * sizeof (EFI_FILE_SYSTEM_INFO *));
if (mFsInfo == NULL) {
// If we can't do this then we can't support file system entries
mFsCount = 0;

View File

@ -49,7 +49,7 @@ InitializeAcpiTableDxe (
//
// Initialize our protocol
//
PrivateData = AllocateZeroPool (sizeof (EFI_ACPI_TABLE_INSTANCE));
PrivateData = AllocateZeroPool(sizeof (EFI_ACPI_TABLE_INSTANCE));
// ASSERT (PrivateData);
if (!PrivateData) {
return EFI_OUT_OF_RESOURCES;

View File

@ -99,7 +99,7 @@ EfiGrowBuffer (
FreePool(*Buffer);
}
*Buffer = AllocateZeroPool (BufferSize);
*Buffer = AllocateZeroPool(BufferSize);
if (*Buffer != NULL) {
TryAgain = TRUE;
@ -234,7 +234,7 @@ EfiLibFileSystemVolumeLabelInfo (
if (Status == EFI_BUFFER_TOO_SMALL) {
// inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name
Size += 2;
VolumeInfo = AllocateZeroPool (Size);
VolumeInfo = AllocateZeroPool(Size);
Status = FHand->GetInfo (FHand, &gEfiFileSystemVolumeLabelInfoIdGuid, &Size, VolumeInfo);
// Check to make sure this isn't actually EFI_FILE_SYSTEM_INFO
if (!EFI_ERROR(Status))
@ -334,7 +334,7 @@ EfiLibFileInfo (
if (Status == EFI_BUFFER_TOO_SMALL) {
// inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name
Size += 2;
FileInfo = AllocateZeroPool (Size);
FileInfo = AllocateZeroPool(Size);
Status = FHand->GetInfo (FHand, &gEfiFileInfoGuid, &Size, FileInfo);
}
@ -358,7 +358,7 @@ EfiLibFileSystemInfo (
if (Status == EFI_BUFFER_TOO_SMALL) {
// inc size by 2 because some drivers (HFSPlus.efi) do not count 0 at the end of file name
Size += 2;
FileSystemInfo = AllocateZeroPool (Size);
FileSystemInfo = AllocateZeroPool(Size);
Status = FHand->GetInfo (FHand, &gEfiFileSystemInfoGuid, &Size, FileSystemInfo);
}
@ -415,7 +415,7 @@ EfiReallocatePool (
NewPool = NULL;
if (NewSize != 0) {
NewPool = AllocateZeroPool (NewSize);
NewPool = AllocateZeroPool(NewSize);
}
if (OldPool != NULL) {

View File

@ -288,7 +288,7 @@ BootMaintExtractConfig (
//
EFI_STRING ConfigRequestHdr = HiiConstructConfigHdr (&gBootMaintFormSetGuid, mBootMaintStorageName, Private->BmmDriverHandle);
Size = (StrLen (ConfigRequestHdr) + 32 + 1) * sizeof (CHAR16);
ConfigRequest = AllocateZeroPool (Size);
ConfigRequest = AllocateZeroPool(Size);
// ASSERT (ConfigRequest != NULL);
if (!ConfigRequest) {
return EFI_OUT_OF_RESOURCES;
@ -1177,7 +1177,7 @@ InitializeBM (
//
// Allocate the storage for the entire Package List
//
PackageListHeader = AllocateZeroPool (Length);
PackageListHeader = AllocateZeroPool(Length);
//
// If the Package List can not be allocated, then return a NULL HII Handle
@ -1341,7 +1341,7 @@ InitializeStringDepository (
)
{
STRING_DEPOSITORY *StringDepository;
StringDepository = AllocateZeroPool (sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER);
StringDepository = AllocateZeroPool(sizeof (STRING_DEPOSITORY) * STRING_DEPOSITORY_NUMBER);
FileOptionStrDepository = StringDepository++;
// ConsoleOptionStrDepository = StringDepository++;
BootOptionStrDepository = StringDepository++;
@ -1380,7 +1380,7 @@ GetStringTokenFromDepository (
//
// If there is no usable node in the list, update the list.
//
NextListNode = AllocateZeroPool (sizeof (STRING_LIST_NODE));
NextListNode = AllocateZeroPool(sizeof (STRING_LIST_NODE));
ASSERT (NextListNode != NULL);
NextListNode->StringToken = HiiSetString (CallbackData->BmmHiiHandle, 0, L" ", NULL);
ASSERT (NextListNode->StringToken != 0);
@ -1580,7 +1580,7 @@ InitBMPackage (
//
// Create CallbackData structures for Driver Callback
//
BmmCallbackInfo = AllocateZeroPool (sizeof (BMM_CALLBACK_DATA));
BmmCallbackInfo = AllocateZeroPool(sizeof (BMM_CALLBACK_DATA));
if (BmmCallbackInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -1588,7 +1588,7 @@ InitBMPackage (
//
// Create LoadOption in BmmCallbackInfo for Driver Callback
//
Ptr = AllocateZeroPool (sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
Ptr = AllocateZeroPool(sizeof (BM_LOAD_CONTEXT) + sizeof (BM_FILE_CONTEXT) + sizeof (BM_HANDLE_CONTEXT) + sizeof (BM_MENU_ENTRY));
if (Ptr == NULL) {
FreePool(BmmCallbackInfo);
BmmCallbackInfo = NULL;

View File

@ -76,12 +76,12 @@ BOpt_CreateMenuEntry (
//
// Create new menu entry
//
MenuEntry = AllocateZeroPool (sizeof (BM_MENU_ENTRY));
MenuEntry = AllocateZeroPool(sizeof (BM_MENU_ENTRY));
if (MenuEntry == NULL) {
return NULL;
}
MenuEntry->VariableContext = AllocateZeroPool (ContextSize);
MenuEntry->VariableContext = AllocateZeroPool(ContextSize);
if (MenuEntry->VariableContext == NULL) {
FreePool(MenuEntry);
return NULL;
@ -283,7 +283,7 @@ BOpt_FindFileSystem (
// Issue a dummy read to trigger reinstall of BlockIo protocol for removable media
//
if (BlkIo->Media->RemovableMedia) {
Buffer = AllocateZeroPool (BlkIo->Media->BlockSize);
Buffer = AllocateZeroPool(BlkIo->Media->BlockSize);
if (NULL == Buffer) {
FreePool(BlkIoHandle);
return EFI_OUT_OF_RESOURCES;
@ -389,7 +389,7 @@ BOpt_FindFileSystem (
}
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -437,7 +437,7 @@ BOpt_FindFileSystem (
MenuEntry->HelpString = FileDevicePathToStr (FileContext->DevicePath);
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -496,7 +496,7 @@ BOpt_FindFileSystem (
MenuEntry->HelpString = FileDevicePathToStr (FileContext->DevicePath);
TempStr = MenuEntry->HelpString;
MenuEntry->DisplayString = AllocateZeroPool (MAX_CHAR);
MenuEntry->DisplayString = AllocateZeroPool(MAX_CHAR);
ASSERT (MenuEntry->DisplayString != NULL);
UnicodeSPrint (
MenuEntry->DisplayString,
@ -606,7 +606,7 @@ BOpt_FindFiles (
);
DirBufferSize = sizeof (EFI_FILE_INFO) + 1024;
DirInfo = AllocateZeroPool (DirBufferSize);
DirInfo = AllocateZeroPool(DirBufferSize);
if (DirInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -668,7 +668,7 @@ BOpt_FindFiles (
if (NewFileContext->IsDir) {
BufferSize = StrLen (DirInfo->FileName) * 2 + 6;
NewMenuEntry->DisplayString = AllocateZeroPool (BufferSize);
NewMenuEntry->DisplayString = AllocateZeroPool(BufferSize);
UnicodeSPrint (
NewMenuEntry->DisplayString,
@ -936,7 +936,7 @@ BOpt_GetBootOptions (
continue;
}
LoadOption = AllocateZeroPool (BootOptionSize);
LoadOption = AllocateZeroPool(BootOptionSize);
if (LoadOption == NULL) {
continue;
}
@ -1022,7 +1022,7 @@ BOpt_GetBootOptions (
StringSize = StrSize((UINT16*)LoadOptionPtr);
NewLoadContext->Description = AllocateZeroPool (StringSize);
NewLoadContext->Description = AllocateZeroPool(StringSize);
// ASSERT (NewLoadContext->Description != NULL);
StrCpyS (NewLoadContext->Description, StringSize / sizeof(CHAR16), (UINT16*)LoadOptionPtr);
@ -1031,7 +1031,7 @@ BOpt_GetBootOptions (
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
@ -1057,7 +1057,7 @@ BOpt_GetBootOptions (
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,
@ -1110,10 +1110,10 @@ BOpt_AppendFileName (
Size2 = StrSize (Str2);
Size = Size1 + Size2 + sizeof (CHAR16);
Len = Size / 2; //including zero terminating
Str = AllocateZeroPool (Size);
Str = AllocateZeroPool(Size);
// ASSERT (Str != NULL);
TmpStr = AllocateZeroPool (Size);
TmpStr = AllocateZeroPool(Size);
// ASSERT (TmpStr != NULL);
StrCatS (Str, Len, Str1);
@ -1531,7 +1531,7 @@ BOpt_GetDriverOptions (
continue;
}
LoadOption = AllocateZeroPool (DriverOptionSize);
LoadOption = AllocateZeroPool(DriverOptionSize);
if (LoadOption == NULL) {
continue;
}
@ -1571,7 +1571,7 @@ BOpt_GetDriverOptions (
LoadOptionPtr += sizeof (UINT16);
StringSize = StrSize ((UINT16 *) LoadOptionPtr);
NewLoadContext->Description = AllocateZeroPool (StringSize);
NewLoadContext->Description = AllocateZeroPool(StringSize);
ASSERT (NewLoadContext->Description != NULL);
CopyMem (
NewLoadContext->Description,
@ -1582,7 +1582,7 @@ BOpt_GetDriverOptions (
LoadOptionPtr += StringSize;
NewLoadContext->FilePathList = AllocateZeroPool (NewLoadContext->FilePathListLength);
NewLoadContext->FilePathList = AllocateZeroPool(NewLoadContext->FilePathListLength);
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
NewLoadContext->FilePathList,
@ -1608,7 +1608,7 @@ BOpt_GetDriverOptions (
StringSize -
NewLoadContext->FilePathListLength;
NewLoadContext->OptionalData = AllocateZeroPool (OptionalDataSize);
NewLoadContext->OptionalData = AllocateZeroPool(OptionalDataSize);
ASSERT (NewLoadContext->OptionalData != NULL);
CopyMem (
NewLoadContext->OptionalData,

View File

@ -813,7 +813,7 @@ UpdateConModePage (
// ASSERT (OptionsOpCodeHandle != NULL);
if (!OptionsOpCodeHandle) return;
ModeToken = AllocateZeroPool (sizeof (EFI_STRING_ID) * ValidMode);
ModeToken = AllocateZeroPool(sizeof (EFI_STRING_ID) * ValidMode);
// ASSERT(ModeToken != NULL);
if (!ModeToken) return;

View File

@ -138,7 +138,7 @@ Var_ChangeBootOrder (
BootOrderListSize = BootOptionMenu.MenuNumber;
if (BootOrderListSize > 0) {
BootOrderList = AllocateZeroPool (BootOrderListSize * sizeof (UINT16));
BootOrderList = AllocateZeroPool(BootOrderListSize * sizeof (UINT16));
// ASSERT (BootOrderList != NULL);
BootOrderListPtr = BootOrderList;
@ -276,7 +276,7 @@ Var_ChangeDriverOrder (
DriverOrderListSize = DriverOptionMenu.MenuNumber;
if (DriverOrderListSize > 0) {
DriverOrderList = AllocateZeroPool (DriverOrderListSize * sizeof (UINT16));
DriverOrderList = AllocateZeroPool(DriverOrderListSize * sizeof (UINT16));
ASSERT (DriverOrderList != NULL);
DriverOrderListPtr = DriverOrderList;
@ -583,7 +583,7 @@ Var_UpdateDriverOption (
BufferSize += StrSize (OptionalData);
}
Buffer = AllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool(BufferSize);
if (NULL == Buffer) {
return EFI_OUT_OF_RESOURCES;
}
@ -615,7 +615,7 @@ Var_UpdateDriverOption (
StrSize (DescriptionData)
);
NewLoadContext->Description = AllocateZeroPool (StrSize (DescriptionData));
NewLoadContext->Description = AllocateZeroPool(StrSize (DescriptionData));
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
CopyMem (
@ -631,7 +631,7 @@ Var_UpdateDriverOption (
GetDevicePathSize (CallbackData->LoadContext->FilePathList)
);
NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList));
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
@ -677,7 +677,7 @@ Var_UpdateDriverOption (
&gEfiGlobalVariableGuid,
&DriverOrderListSize
);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize + sizeof (UINT16));
NewDriverOrderList = AllocateZeroPool(DriverOrderListSize + sizeof (UINT16));
ASSERT (NewDriverOrderList != NULL);
if (DriverOrderList != NULL) {
CopyMem (NewDriverOrderList, DriverOrderList, DriverOrderListSize);
@ -767,7 +767,7 @@ Var_UpdateBootOption (
BufferSize += StrSize (NvRamMap->BootOptionalData);
}
Buffer = AllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool(BufferSize);
if (NULL == Buffer) {
return EFI_OUT_OF_RESOURCES;
}
@ -799,7 +799,7 @@ Var_UpdateBootOption (
StrSize (NvRamMap->BootDescriptionData)
);
NewLoadContext->Description = AllocateZeroPool (StrSize (NvRamMap->BootDescriptionData));
NewLoadContext->Description = AllocateZeroPool(StrSize (NvRamMap->BootDescriptionData));
ASSERT (NewLoadContext->Description != NULL);
NewMenuEntry->DisplayString = NewLoadContext->Description;
@ -816,7 +816,7 @@ Var_UpdateBootOption (
GetDevicePathSize (CallbackData->LoadContext->FilePathList)
);
NewLoadContext->FilePathList = AllocateZeroPool (GetDevicePathSize (CallbackData->LoadContext->FilePathList));
NewLoadContext->FilePathList = AllocateZeroPool(GetDevicePathSize (CallbackData->LoadContext->FilePathList));
ASSERT (NewLoadContext->FilePathList != NULL);
CopyMem (
@ -861,7 +861,7 @@ Var_UpdateBootOption (
);
// ASSERT (BootOrderList != NULL);
if (BootOrderList != NULL) {
NewBootOrderList = AllocateZeroPool (BootOrderListSize + sizeof (UINT16));
NewBootOrderList = AllocateZeroPool(BootOrderListSize + sizeof (UINT16));
// ASSERT (NewBootOrderList != NULL);
if (NewBootOrderList != NULL) {
CopyMem (NewBootOrderList, BootOrderList, BootOrderListSize);
@ -1064,7 +1064,7 @@ Var_UpdateDriverOrder (
&DriverOrderListSize
);
NewDriverOrderList = AllocateZeroPool (DriverOrderListSize);
NewDriverOrderList = AllocateZeroPool(DriverOrderListSize);
if (NewDriverOrderList == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -1209,7 +1209,7 @@ Var_UpdateBBSOption (
return EFI_NOT_FOUND;
}
NewOrder = AllocateZeroPool (DevOrder->Length - sizeof (DevOrder->Length));
NewOrder = AllocateZeroPool(DevOrder->Length - sizeof (DevOrder->Length));
if (NewOrder == NULL) {
FreePool(OriginalPtr);
return EFI_OUT_OF_RESOURCES;

View File

@ -330,7 +330,7 @@ CallBootManager (
TempStr = FileDevicePathToStr (Option->DevicePath);
TempSize = StrSize (TempStr);
HelpSize = TempSize + StrSize (L"Device Path : ");
HelpString = AllocateZeroPool (HelpSize);
HelpString = AllocateZeroPool(HelpSize);
// ASSERT (HelpString != NULL);
if (!HelpString) {
return;

View File

@ -91,11 +91,11 @@ BdsProcessCapsules (
//
// Init temp Capsule Data table.
//
CapsulePtr = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleTotalNumber);
CapsulePtr = (VOID **) AllocateZeroPool(sizeof (VOID *) * CapsuleTotalNumber);
// ASSERT (CapsulePtr != NULL);
CapsulePtrCache = (VOID **) AllocateZeroPool (sizeof (VOID *) * CapsuleTotalNumber);
CapsulePtrCache = (VOID **) AllocateZeroPool(sizeof (VOID *) * CapsuleTotalNumber);
// ASSERT (CapsulePtrCache != NULL);
CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool (sizeof (EFI_GUID) * CapsuleTotalNumber);
CapsuleGuidCache = (EFI_GUID *) AllocateZeroPool(sizeof (EFI_GUID) * CapsuleTotalNumber);
// ASSERT (CapsuleGuidCache != NULL);
//

View File

@ -387,7 +387,7 @@ GetMacAddressString(
// The size is the Number size + ":" size + Vlan size(\XXXX) + End
//
BufferLen = (4 + 2 * HwAddressSize + (HwAddressSize - 1) + 5 + 1) * sizeof (CHAR16);
String = AllocateZeroPool (BufferLen);
String = AllocateZeroPool(BufferLen);
if (String == NULL) {
return FALSE;
}
@ -770,14 +770,14 @@ AdjustArrayData (
//
// +2 means include the new HiiHandle and the last empty NULL pointer.
//
NewHiiHandles = AllocateZeroPool ((ArrayCount + 2) * sizeof (EFI_HII_HANDLE));
NewHiiHandles = AllocateZeroPool((ArrayCount + 2) * sizeof (EFI_HII_HANDLE));
ASSERT (NewHiiHandles != NULL);
CopyMem (NewHiiHandles, *HiiHandles, Offset * sizeof (EFI_HII_HANDLE));
NewHiiHandles[Offset] = NewHiiHandles[Offset - 1];
CopyMem (NewHiiHandles + Offset + 1, *HiiHandles + Offset, (ArrayCount - Offset) * sizeof (EFI_HII_HANDLE));
NewGuidLists = AllocateZeroPool ((ArrayCount + 2) * sizeof (EFI_GUID *));
NewGuidLists = AllocateZeroPool((ArrayCount + 2) * sizeof (EFI_GUID *));
ASSERT (NewGuidLists != NULL);
CopyMem (NewGuidLists, *GuidLists, Offset * sizeof (EFI_GUID *));
@ -932,7 +932,7 @@ CallDeviceManager (
}
HandleNum = GetHiiHandleCount (HiiHandles);
GuidLists = AllocateZeroPool ((HandleNum + 1) * sizeof (EFI_GUID *));
GuidLists = AllocateZeroPool((HandleNum + 1) * sizeof (EFI_GUID *));
ASSERT (GuidLists != NULL);
//
@ -1392,7 +1392,7 @@ CallDriverHealth (
//
// Assume no line strings is longer than 512 bytes.
//
String = (EFI_STRING) AllocateZeroPool (0x200);
String = (EFI_STRING) AllocateZeroPool(0x200);
// ASSERT (String != NULL);
if (!String) {
break;
@ -1722,7 +1722,7 @@ GetSingleControllerHealthStatus (
//
// Add the driver health related information into the list
//
DriverHealthInfo = AllocateZeroPool (sizeof (DRIVER_HEALTH_INFO));
DriverHealthInfo = AllocateZeroPool(sizeof (DRIVER_HEALTH_INFO));
if (DriverHealthInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -1759,7 +1759,7 @@ GetSingleControllerHealthStatus (
//
// Add the driver health related information into the list
//
DriverHealthInfo = AllocateZeroPool (sizeof (DRIVER_HEALTH_INFO));
DriverHealthInfo = AllocateZeroPool(sizeof (DRIVER_HEALTH_INFO));
if (DriverHealthInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -438,7 +438,7 @@ InitializeFrontPage (
//
// Allocate extra 1 as the end tag.
//
gFrontPagePrivate.LanguageToken = AllocateZeroPool ((OptionCount + 1) * sizeof (EFI_STRING_ID));
gFrontPagePrivate.LanguageToken = AllocateZeroPool((OptionCount + 1) * sizeof (EFI_STRING_ID));
ASSERT (gFrontPagePrivate.LanguageToken != NULL);
Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString);
@ -452,7 +452,7 @@ InitializeFrontPage (
StringSize = 0;
Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);
if (Status == EFI_BUFFER_TOO_SMALL) {
StringBuffer = AllocateZeroPool (StringSize);
StringBuffer = AllocateZeroPool(StringSize);
ASSERT (StringBuffer != NULL);
Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);
ASSERT_EFI_ERROR(Status);
@ -636,7 +636,7 @@ ConvertProcessorToString (
FreqMhz = 0;
}
StringBuffer = AllocateZeroPool (0x20);
StringBuffer = AllocateZeroPool(0x20);
// ASSERT (StringBuffer != NULL);
if (!StringBuffer) {
StringBuffer = L" ";
@ -665,7 +665,7 @@ ConvertMemorySizeToString (
{
CHAR16 *StringBuffer;
StringBuffer = AllocateZeroPool (0x20);
StringBuffer = AllocateZeroPool(0x20);
// ASSERT (StringBuffer != NULL);
if (!StringBuffer) {
StringBuffer = L" ";
@ -701,7 +701,7 @@ GetOptionalStringByIndex (
UINTN StrSize;
if (Index == 0) {
*String = AllocateZeroPool (sizeof (CHAR16));
*String = AllocateZeroPool(sizeof (CHAR16));
return EFI_SUCCESS;
}

View File

@ -571,7 +571,7 @@ HotkeyInsertList (
EFI_INPUT_KEY *InputKey;
EFI_KEY_DATA *KeyData;
HotkeyLeft = AllocateZeroPool (sizeof (BDS_HOTKEY_OPTION));
HotkeyLeft = AllocateZeroPool(sizeof (BDS_HOTKEY_OPTION));
if (HotkeyLeft == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -723,7 +723,7 @@ HotkeyGetOptionNumbers (
OptionNumbers = NULL;
NameSize = sizeof (CHAR16);
Name = AllocateZeroPool (NameSize);
Name = AllocateZeroPool(NameSize);
// ASSERT (Name != NULL);
if (Name == NULL) {
return NULL;

View File

@ -351,7 +351,7 @@ IsLangInSupportedLangCodes(
if (Iso639Language) {
CompareLength = ISO_639_2_ENTRY_SIZE;
for (Index = 0; Index < AsciiStrLen (SupportedLang); Index += CompareLength) {
for (Index = 0; Index < AsciiStrLen(SupportedLang); Index += CompareLength) {
if (AsciiStrnCmp (Lang, SupportedLang + Index, CompareLength) == 0) {
//
// Successfully find the Lang string in SupportedLang string.

View File

@ -796,7 +796,7 @@ FvIsBeingProcesssed (
}
}
KnownHandle = AllocateZeroPool (sizeof (KNOWN_HANDLE));
KnownHandle = AllocateZeroPool(sizeof (KNOWN_HANDLE));
ASSERT (KnownHandle != NULL);
KnownHandle->Signature = KNOWN_HANDLE_SIGNATURE;
@ -895,7 +895,7 @@ CoreAddToDriverList (
// Create the Driver Entry for the list. ZeroPool initializes lots of variables to
// NULL or FALSE.
//
DriverEntry = AllocateZeroPool (sizeof (EFI_CORE_DRIVER_ENTRY));
DriverEntry = AllocateZeroPool(sizeof (EFI_CORE_DRIVER_ENTRY));
ASSERT (DriverEntry != NULL);
if (Type == EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE) {
DriverEntry->IsFvImage = TRUE;

View File

@ -462,7 +462,7 @@ CoreCreateEventInternal (
if ((Type & EVT_RUNTIME) != 0) {
IEvent = AllocateRuntimeZeroPool (sizeof (IEVENT));
} else {
IEvent = AllocateZeroPool (sizeof (IEVENT));
IEvent = AllocateZeroPool(sizeof (IEVENT));
}
if (IEvent == NULL) {
return EFI_OUT_OF_RESOURCES;

View File

@ -497,7 +497,7 @@ FvCheck (
//
// Create a FFS list entry for each non-deleted file
//
FfsFileEntry = AllocateZeroPool (sizeof (FFS_FILE_LIST_ENTRY));
FfsFileEntry = AllocateZeroPool(sizeof (FFS_FILE_LIST_ENTRY));
if (FfsFileEntry == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;

View File

@ -381,12 +381,12 @@ CoreAllocateGcdMapEntry (
IN OUT EFI_GCD_MAP_ENTRY **BottomEntry
)
{
*TopEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY));
*TopEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY));
if (*TopEntry == NULL) {
return EFI_OUT_OF_RESOURCES;
}
*BottomEntry = AllocateZeroPool (sizeof (EFI_GCD_MAP_ENTRY));
*BottomEntry = AllocateZeroPool(sizeof (EFI_GCD_MAP_ENTRY));
if (*BottomEntry == NULL) {
CoreFreePool(*TopEntry);
return EFI_OUT_OF_RESOURCES;

View File

@ -394,7 +394,7 @@ CoreInstallProtocolInterfaceNotify (
//
// Allocate a new protocol interface structure
//
Prot = AllocateZeroPool (sizeof(PROTOCOL_INTERFACE));
Prot = AllocateZeroPool(sizeof(PROTOCOL_INTERFACE));
if (Prot == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -405,7 +405,7 @@ CoreInstallProtocolInterfaceNotify (
//
Handle = (IHANDLE *)*UserHandle;
if (Handle == NULL) {
Handle = AllocateZeroPool (sizeof(IHANDLE));
Handle = AllocateZeroPool(sizeof(IHANDLE));
if (Handle == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;

View File

@ -1202,7 +1202,7 @@ CoreLoadImageCommon (
//
// Allocate a new image structure
//
Image = AllocateZeroPool (sizeof(LOADED_IMAGE_PRIVATE_DATA));
Image = AllocateZeroPool(sizeof(LOADED_IMAGE_PRIVATE_DATA));
if (Image == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -201,7 +201,7 @@ CoreNewDebugImageInfoEntry (
// Table is full, so re-allocate another page for a larger table...
//
TableSize = mMaxTableEntries * EFI_DEBUG_TABLE_ENTRY_SIZE;
NewTable = AllocateZeroPool (TableSize + EFI_PAGE_SIZE);
NewTable = AllocateZeroPool(TableSize + EFI_PAGE_SIZE);
if (NewTable == NULL) {
mDebugInfoTableHeader.UpdateStatus &= ~EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS;
return;
@ -230,7 +230,7 @@ CoreNewDebugImageInfoEntry (
//
// Allocate data for new entry
//
Table[Index].NormalImage = AllocateZeroPool (sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL));
Table[Index].NormalImage = AllocateZeroPool(sizeof (EFI_DEBUG_IMAGE_INFO_NORMAL));
if (Table[Index].NormalImage != NULL) {
//
// Update the entry

View File

@ -697,7 +697,7 @@ CreateChildNode (
//
// Allocate a new node
//
*ChildNode = AllocateZeroPool (sizeof (CORE_SECTION_CHILD_NODE));
*ChildNode = AllocateZeroPool(sizeof (CORE_SECTION_CHILD_NODE));
Node = *ChildNode;
if (Node == NULL) {
return EFI_OUT_OF_RESOURCES;

View File

@ -1635,7 +1635,7 @@ Returns:
}
if (Resources != NULL) {
Configuration = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR));
Configuration = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR));
if (Configuration == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -70,7 +70,7 @@ InstallProcessorSmbios (
// Set ProcessorVersion string
//
AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type4->ProcessorVersion);
UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16));
UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16));
ASSERT (UString != NULL);
AsciiStrToUnicodeStr (AString, UString);
@ -137,7 +137,7 @@ InstallMiscSmbios (
// Record Type 2
//
AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type0->BiosVersion);
UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE));
UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_BIOS_VERSIONE));
ASSERT (UString != NULL);
CopyMem (UString, FIRMWARE_BIOS_VERSIONE, sizeof(FIRMWARE_BIOS_VERSIONE));
AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_BIOS_VERSIONE) / sizeof(CHAR16) - 1);
@ -167,7 +167,7 @@ InstallMiscSmbios (
// Record Type 3
//
AString = GetSmbiosString (SmbiosTable, SmbiosTable.Type1->ProductName);
UString = AllocateZeroPool ((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME));
UString = AllocateZeroPool((AsciiStrLen(AString) + 1) * sizeof(CHAR16) + sizeof(FIRMWARE_PRODUCT_NAME));
ASSERT (UString != NULL);
CopyMem (UString, FIRMWARE_PRODUCT_NAME, sizeof(FIRMWARE_PRODUCT_NAME));
AsciiStrToUnicodeStr (AString, UString + sizeof(FIRMWARE_PRODUCT_NAME) / sizeof(CHAR16) - 1);

View File

@ -57,7 +57,7 @@ Returns:
//
// Initialize the Device IO device instance.
//
Private = AllocateZeroPool (sizeof (DEVICE_IO_PRIVATE_DATA));
Private = AllocateZeroPool(sizeof (DEVICE_IO_PRIVATE_DATA));
if (Private == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -56,7 +56,7 @@ InternalPrintMessage (
//
// Send the print string to a Serial Port
//
SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen (Buffer));
SerialPortWrite ((UINT8 *)Buffer, AsciiStrLen(Buffer));
}
/**
@ -170,4 +170,4 @@ ReadAndVerifyVectorInfo (
VectorInfo ++;
}
return EFI_SUCCESS;
}
}

View File

@ -89,7 +89,7 @@ InitializeCpuInterruptHandlers (
}
}
InitializeSpinLock (&mDisplayMessageSpinLock);
mExternalInterruptHandler = AllocateZeroPool (sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM);
mExternalInterruptHandler = AllocateZeroPool(sizeof (EFI_CPU_INTERRUPT_HANDLER) * CPU_INTERRUPT_NUM);
ASSERT (mExternalInterruptHandler != NULL);
//
@ -103,7 +103,7 @@ InitializeCpuInterruptHandlers (
//
// Create Interrupt Descriptor Table and Copy the old IDT table in
//
IdtTable = AllocateZeroPool (sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM);
IdtTable = AllocateZeroPool(sizeof (IA32_IDT_GATE_DESCRIPTOR) * CPU_INTERRUPT_NUM);
ASSERT (IdtTable != NULL);
CopyMem (IdtTable, (VOID *)IdtDescriptor.Base, sizeof (IA32_IDT_GATE_DESCRIPTOR) * IdtEntryCount);

View File

@ -1062,7 +1062,7 @@ CreateNewDeviceInfo (
{
EFI_ATA_DEVICE_INFO *DeviceInfo;
DeviceInfo = AllocateZeroPool (sizeof (EFI_ATA_DEVICE_INFO));
DeviceInfo = AllocateZeroPool(sizeof (EFI_ATA_DEVICE_INFO));
if (DeviceInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -1364,7 +1364,7 @@ AtaPassThruPassThru (
// For non-blocking mode, queue the Task into the list.
//
if (Event != NULL) {
Task = AllocateZeroPool (sizeof (ATA_NONBLOCK_TASK));
Task = AllocateZeroPool(sizeof (ATA_NONBLOCK_TASK));
if (Task == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -867,7 +867,7 @@ AtaBusDriverBindingStart (
// Check EFI_ALREADY_STARTED to reuse the original ATA_BUS_DRIVER_DATA.
//
if (Status != EFI_ALREADY_STARTED) {
AtaBusDriverData = AllocateZeroPool (sizeof (ATA_BUS_DRIVER_DATA));
AtaBusDriverData = AllocateZeroPool(sizeof (ATA_BUS_DRIVER_DATA));
if (AtaBusDriverData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -770,7 +770,7 @@ AccessAtaDevice(
if ((Token != NULL) && (Token->Event != NULL)) {
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) {
AtaTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_TASK));
AtaTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_TASK));
if (AtaTask == NULL) {
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
@ -790,12 +790,12 @@ AccessAtaDevice(
gBS->RestoreTPL (OldTpl);
Token->TransactionStatus = EFI_SUCCESS;
EventCount = AllocateZeroPool (sizeof (UINTN));
EventCount = AllocateZeroPool(sizeof (UINTN));
if (EventCount == NULL) {
return EFI_OUT_OF_RESOURCES;
}
IsError = AllocateZeroPool (sizeof (BOOLEAN));
IsError = AllocateZeroPool(sizeof (BOOLEAN));
if (IsError == NULL) {
FreePool(EventCount);
return EFI_OUT_OF_RESOURCES;
@ -831,7 +831,7 @@ AccessAtaDevice(
// SubTask = NULL;
SubEvent = NULL;
SubTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_SUB_TASK));
SubTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_SUB_TASK));
if (SubTask == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto EXIT;

View File

@ -1147,7 +1147,7 @@ ScsiScanCreateDevice (
goto ErrorExit;
}
ScsiIoDevice = AllocateZeroPool (sizeof (SCSI_IO_DEV));
ScsiIoDevice = AllocateZeroPool(sizeof (SCSI_IO_DEV));
if (ScsiIoDevice == NULL) {
DBG(L"AllocateZeroPool Status=%r\n", Status);
Status = EFI_OUT_OF_RESOURCES;

View File

@ -212,7 +212,7 @@ ScsiDiskDriverBindingStart (
MustReadCapacity = TRUE;
ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool (sizeof (SCSI_DISK_DEV));
ScsiDiskDevice = (SCSI_DISK_DEV *) AllocateZeroPool(sizeof (SCSI_DISK_DEV));
if (ScsiDiskDevice == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -256,7 +256,7 @@ ScsiDiskDriverBindingStart (
// The Sense Data Array's initial size is 6
//
ScsiDiskDevice->SenseDataNumber = 6;
ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool (
ScsiDiskDevice->SenseData = (EFI_SCSI_SENSE_DATA *) AllocateZeroPool(
sizeof (EFI_SCSI_SENSE_DATA) * ScsiDiskDevice->SenseDataNumber
);
if (ScsiDiskDevice->SenseData == NULL) {

View File

@ -589,7 +589,7 @@ IsaCreateDevice (
//
// Initialize the PCI_IO_DEVICE structure
//
IsaIoDevice = AllocateZeroPool (sizeof (ISA_IO_DEVICE));
IsaIoDevice = AllocateZeroPool(sizeof (ISA_IO_DEVICE));
if (IsaIoDevice == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -600,7 +600,7 @@ KeyboardRegisterKeyNotify (
//
// Allocate resource to save the notification function
//
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
if (NewNotify == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;

View File

@ -226,7 +226,7 @@ KbdControllerDriverStart (
//
// Allocate private data
//
ConsoleIn = AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_DEV));
ConsoleIn = AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_DEV));
if (ConsoleIn == NULL) {
Status = EFI_OUT_OF_RESOURCES;
StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR;

View File

@ -195,7 +195,7 @@ PS2MouseAbsolutePointerDriverStart (
//
// Allocate private data
//
MouseAbsolutePointerDev = AllocateZeroPool (sizeof (PS2_MOUSE_ABSOLUTE_POINTER_DEV));
MouseAbsolutePointerDev = AllocateZeroPool(sizeof (PS2_MOUSE_ABSOLUTE_POINTER_DEV));
if (MouseAbsolutePointerDev == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -198,7 +198,7 @@ PS2MouseDriverStart (
//
// Allocate private data
//
MouseDev = AllocateZeroPool (sizeof (PS2_MOUSE_DEV));
MouseDev = AllocateZeroPool(sizeof (PS2_MOUSE_DEV));
if (MouseDev == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -2042,7 +2042,7 @@ OhciAllocateDev (
UINTN Pages;
UINTN Bytes;
Ohc = AllocateZeroPool (sizeof (USB_OHCI_HC_DEV));
Ohc = AllocateZeroPool(sizeof (USB_OHCI_HC_DEV));
if (Ohc == NULL) {
return NULL;
}

View File

@ -275,12 +275,12 @@ PartitionInstallGptChildHandles (
//
// Allocate the GPT structures
//
PrimaryHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER));
PrimaryHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER));
if (PrimaryHeader == NULL) {
goto Done;
}
BackupHeader = AllocateZeroPool (sizeof (EFI_PARTITION_TABLE_HEADER));
BackupHeader = AllocateZeroPool(sizeof (EFI_PARTITION_TABLE_HEADER));
if (BackupHeader == NULL) {
goto Done;
}
@ -346,7 +346,7 @@ PartitionInstallGptChildHandles (
// DEBUG ((EFI_D_INFO, " Number of partition entries: %d\n", PrimaryHeader->NumberOfPartitionEntries));
PEntryStatus = AllocateZeroPool (PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS));
PEntryStatus = AllocateZeroPool(PrimaryHeader->NumberOfPartitionEntries * sizeof (EFI_PARTITION_ENTRY_STATUS));
if (PEntryStatus == NULL) {
// DEBUG ((EFI_D_ERROR, "Allocate pool error\n"));
goto Done;
@ -467,7 +467,7 @@ PartitionValidGptTable (
BlockSize = BlockIo->Media->BlockSize;
MediaId = BlockIo->Media->MediaId;
PartHdr = AllocateZeroPool (BlockSize);
PartHdr = AllocateZeroPool(BlockSize);
if (PartHdr == NULL) {
DEBUG ((EFI_D_ERROR, "Allocate pool error\n"));
@ -609,7 +609,7 @@ PartitionRestoreGptTable (
BlockSize = BlockIo->Media->BlockSize;
MediaId = BlockIo->Media->MediaId;
PartHdr = AllocateZeroPool (BlockSize);
PartHdr = AllocateZeroPool(BlockSize);
if (PartHdr == NULL) {
DEBUG ((EFI_D_ERROR, "Allocate pool error\n"));

View File

@ -1121,7 +1121,7 @@ PartitionInstallChildHandle (
PARTITION_PRIVATE_DATA *Private;
Status = EFI_SUCCESS;
Private = AllocateZeroPool (sizeof (PARTITION_PRIVATE_DATA));
Private = AllocateZeroPool(sizeof (PARTITION_PRIVATE_DATA));
if (Private == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -446,7 +446,7 @@ SataControllerStart (
//
// Allocate Sata Private Data structure
//
SataPrivateData = AllocateZeroPool (sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA));
SataPrivateData = AllocateZeroPool(sizeof (EFI_SATA_CONTROLLER_PRIVATE_DATA));
if (SataPrivateData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -519,19 +519,19 @@ SataControllerStart (
}
ChannelDeviceCount = (UINTN) (SataPrivateData->IdeInit.ChannelCount) * (UINTN) (SataPrivateData->DeviceCount);
SataPrivateData->DisqulifiedModes = AllocateZeroPool ((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount);
SataPrivateData->DisqulifiedModes = AllocateZeroPool((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount);
if (SataPrivateData->DisqulifiedModes == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
SataPrivateData->IdentifyData = AllocateZeroPool ((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount);
SataPrivateData->IdentifyData = AllocateZeroPool((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount);
if (SataPrivateData->IdentifyData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
SataPrivateData->IdentifyValid = AllocateZeroPool ((sizeof (BOOLEAN)) * ChannelDeviceCount);
SataPrivateData->IdentifyValid = AllocateZeroPool((sizeof (BOOLEAN)) * ChannelDeviceCount);
if (SataPrivateData->IdentifyValid == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -826,19 +826,19 @@ IdeInitNotifyPhase (
}
ChannelDeviceCount = (UINTN) (SataPrivateData->IdeInit.ChannelCount) * (UINTN) (SataPrivateData->DeviceCount);
SataPrivateData->DisqulifiedModes = AllocateZeroPool ((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount);
SataPrivateData->DisqulifiedModes = AllocateZeroPool((sizeof (EFI_ATA_COLLECTIVE_MODE)) * ChannelDeviceCount);
if (SataPrivateData->DisqulifiedModes == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
SataPrivateData->IdentifyData = AllocateZeroPool ((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount);
SataPrivateData->IdentifyData = AllocateZeroPool((sizeof (EFI_IDENTIFY_DATA)) * ChannelDeviceCount);
if (SataPrivateData->IdentifyData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
}
SataPrivateData->IdentifyValid = AllocateZeroPool ((sizeof (BOOLEAN)) * ChannelDeviceCount);
SataPrivateData->IdentifyValid = AllocateZeroPool((sizeof (BOOLEAN)) * ChannelDeviceCount);
if (SataPrivateData->IdentifyValid == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -1095,7 +1095,7 @@ IdeInitCalculateMode (
return EFI_INVALID_PARAMETER;
}
*SupportedModes = AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE));
*SupportedModes = AllocateZeroPool(sizeof (EFI_ATA_COLLECTIVE_MODE));
if (*SupportedModes == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -791,7 +791,7 @@ UsbIoGetStringDescriptor (
goto FREE_STR;
}
Buf = AllocateZeroPool (StrDesc->Length);
Buf = AllocateZeroPool(StrDesc->Length);
if (Buf == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@ -929,7 +929,7 @@ UsbBusBuildProtocol (
EFI_STATUS Status;
EFI_STATUS Status2;
UsbBus = AllocateZeroPool (sizeof (USB_BUS));
UsbBus = AllocateZeroPool(sizeof (USB_BUS));
if (UsbBus == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -1030,14 +1030,14 @@ UsbBusBuildProtocol (
//
// Create a fake usb device for root hub
//
RootHub = AllocateZeroPool (sizeof (USB_DEVICE));
RootHub = AllocateZeroPool(sizeof (USB_DEVICE));
if (RootHub == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto UNINSTALL_USBBUS;
}
RootIf = AllocateZeroPool (sizeof (USB_INTERFACE));
RootIf = AllocateZeroPool(sizeof (USB_INTERFACE));
if (RootIf == NULL) {
FreePool(RootHub);

View File

@ -205,7 +205,7 @@ UsbCreateDesc (
return NULL;
}
Desc = AllocateZeroPool ((UINTN) CtrlLen);
Desc = AllocateZeroPool((UINTN) CtrlLen);
if (Desc == NULL) {
return NULL;
}
@ -264,7 +264,7 @@ UsbParseInterfaceDesc (
goto ON_EXIT;
}
Setting->Endpoints = AllocateZeroPool (sizeof (USB_ENDPOINT_DESC *) * NumEp);
Setting->Endpoints = AllocateZeroPool(sizeof (USB_ENDPOINT_DESC *) * NumEp);
if (Setting->Endpoints == NULL) {
goto ON_ERROR;
@ -330,7 +330,7 @@ UsbParseConfigDesc (
// Initialize an array of setting for the configuration's interfaces.
//
NumIf = Config->Desc.NumInterfaces;
Config->Interfaces = AllocateZeroPool (sizeof (USB_INTERFACE_DESC *) * NumIf);
Config->Interfaces = AllocateZeroPool(sizeof (USB_INTERFACE_DESC *) * NumIf);
if (Config->Interfaces == NULL) {
goto ON_ERROR;
@ -340,7 +340,7 @@ UsbParseConfigDesc (
Config->Desc.ConfigurationValue, (UINT32)NumIf));
for (Index = 0; Index < NumIf; Index++) {
Interface = AllocateZeroPool (sizeof (USB_INTERFACE_DESC));
Interface = AllocateZeroPool(sizeof (USB_INTERFACE_DESC));
if (Interface == NULL) {
goto ON_ERROR;
@ -574,7 +574,7 @@ UsbGetDevDesc (
USB_DEVICE_DESC *DevDesc;
EFI_STATUS Status;
DevDesc = AllocateZeroPool (sizeof (USB_DEVICE_DESC));
DevDesc = AllocateZeroPool(sizeof (USB_DEVICE_DESC));
if (DevDesc == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -631,7 +631,7 @@ UsbGetOneString (
return NULL;
}
Buf = AllocateZeroPool (Desc.Length);
Buf = AllocateZeroPool(Desc.Length);
if (Buf == NULL) {
return NULL;
@ -744,7 +744,7 @@ UsbGetOneConfig (
DEBUG (( EFI_D_INFO, "UsbGetOneConfig: total length is %d\n", Desc.TotalLength));
Buf = AllocateZeroPool (Desc.TotalLength);
Buf = AllocateZeroPool(Desc.TotalLength);
if (Buf == NULL) {
return NULL;
@ -803,7 +803,7 @@ UsbBuildDescTable (
return EFI_DEVICE_ERROR;
}
DevDesc->Configs = AllocateZeroPool (NumConfig * sizeof (USB_CONFIG_DESC *));
DevDesc->Configs = AllocateZeroPool(NumConfig * sizeof (USB_CONFIG_DESC *));
if (DevDesc->Configs == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -117,7 +117,7 @@ UsbCreateInterface (
USB_INTERFACE *HubIf;
EFI_STATUS Status;
UsbIf = AllocateZeroPool (sizeof (USB_INTERFACE));
UsbIf = AllocateZeroPool(sizeof (USB_INTERFACE));
if (UsbIf == NULL) {
return NULL;
@ -251,7 +251,7 @@ UsbCreateDevice (
return NULL;
}
Device = AllocateZeroPool (sizeof (USB_DEVICE));
Device = AllocateZeroPool(sizeof (USB_DEVICE));
if (Device == NULL) {
return NULL;

View File

@ -678,7 +678,7 @@ UsbOnHubInterrupt (
// practise since UsbOnHubInterrupt is called in the context
// of host contrller's AsyncInterrupt monitor.
//
HubIf->ChangeMap = AllocateZeroPool (DataLength);
HubIf->ChangeMap = AllocateZeroPool(DataLength);
if (HubIf->ChangeMap == NULL) {
return EFI_OUT_OF_RESOURCES;

View File

@ -810,7 +810,7 @@ GetUsbDPFromFullDP (
//
// Create a new device path which only contain the above Usb part
//
UsbDevicePathPtr = AllocateZeroPool (Size + sizeof (EFI_DEVICE_PATH_PROTOCOL));
UsbDevicePathPtr = AllocateZeroPool(Size + sizeof (EFI_DEVICE_PATH_PROTOCOL));
// ASSERT (UsbDevicePathPtr != NULL);
if (!UsbDevicePathPtr) {
return NULL;
@ -911,7 +911,7 @@ AddUsbDPToList (
//
// Prepare the usbio device path DEVICE_PATH_LIST_ITEM structure.
//
ListItem = AllocateZeroPool (sizeof (DEVICE_PATH_LIST_ITEM));
ListItem = AllocateZeroPool(sizeof (DEVICE_PATH_LIST_ITEM));
// ASSERT (ListItem != NULL);
if (!ListItem) {
return EFI_NOT_FOUND;

View File

@ -210,7 +210,7 @@ USBKeyboardDriverBindingStart (
goto ErrorExit1;
}
UsbKeyboardDevice = AllocateZeroPool (sizeof (USB_KB_DEV));
UsbKeyboardDevice = AllocateZeroPool(sizeof (USB_KB_DEV));
// ASSERT (UsbKeyboardDevice != NULL);
if (!UsbKeyboardDevice) {
goto ErrorExit1;
@ -1287,7 +1287,7 @@ USBKeyboardRegisterKeyNotify (
//
// Allocate resource to save the notification function
//
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
if (NewNotify == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -619,7 +619,7 @@ SetKeyboardLayoutEvent (
// Re-allocate resource for KeyConvertionTable
//
ReleaseKeyboardLayoutResources (UsbKeyboardDevice);
UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR));
UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR));
ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL);
//
@ -648,7 +648,7 @@ SetKeyboardLayoutEvent (
// For non-spacing key, create the list with a non-spacing key followed by physical keys.
//
if (TempKey.Modifier == EFI_NS_KEY_MODIFIER) {
UsbNsKey = AllocateZeroPool (sizeof (USB_NS_KEY));
UsbNsKey = AllocateZeroPool(sizeof (USB_NS_KEY));
ASSERT (UsbNsKey != NULL);
//
@ -746,7 +746,7 @@ InitKeyboardLayout (
EFI_HII_KEYBOARD_LAYOUT *KeyboardLayout;
EFI_STATUS Status;
UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool ((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR));
UsbKeyboardDevice->KeyConvertionTable = AllocateZeroPool((NUMBER_OF_VALID_USB_KEYCODE) * sizeof (EFI_KEY_DESCRIPTOR));
ASSERT (UsbKeyboardDevice->KeyConvertionTable != NULL);
InitializeListHead (&UsbKeyboardDevice->NsKeyList);

View File

@ -193,7 +193,7 @@ USBMouseDriverBindingStart (
DBG("UsbMouse started\n");
UsbMouseDevice = AllocateZeroPool (sizeof (USB_MOUSE_DEV));
UsbMouseDevice = AllocateZeroPool(sizeof (USB_MOUSE_DEV));
ASSERT (UsbMouseDevice != NULL);
UsbMouseDevice->UsbIo = UsbIo;
@ -620,7 +620,7 @@ InitializeUsbMouseDevice (
// By issuing Get_Descriptor(Configuration) request with total length, we get the Configuration descriptor,
// all Interface descriptors, all Endpoint descriptors, and the HID descriptor for each interface.
//
Buf = AllocateZeroPool (ConfigDesc.TotalLength);
Buf = AllocateZeroPool(ConfigDesc.TotalLength);
if (Buf == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -681,7 +681,7 @@ InitializeUsbMouseDevice (
return EFI_UNSUPPORTED;
}
ReportDesc = AllocateZeroPool (MouseHidDesc->HidClassDesc[0].DescriptorLength);
ReportDesc = AllocateZeroPool(MouseHidDesc->HidClassDesc[0].DescriptorLength);
ASSERT (ReportDesc != NULL);
Status = UsbGetReportDescriptor (

View File

@ -42,7 +42,7 @@ UsbHcAllocMemBlock (
PciIo = Pool->PciIo;
Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK));
Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK));
if (Block == NULL) {
return NULL;
}
@ -55,7 +55,7 @@ UsbHcAllocMemBlock (
Block->BufLen = EFI_PAGES_TO_SIZE (Pages);
Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8);
Block->Bits = AllocateZeroPool (Block->BitsLen);
Block->Bits = AllocateZeroPool(Block->BitsLen);
if (Block->Bits == NULL) {
gBS->FreePool(Block);

View File

@ -1060,7 +1060,7 @@ XhcControlTransfer (
} else {
MaxPacket0 = Xhc->UsbDevContext[SlotId].DevDesc.MaxPacketSize0;
}
Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool (Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *));
Xhc->UsbDevContext[SlotId].ConfDesc = AllocateZeroPool(Xhc->UsbDevContext[SlotId].DevDesc.NumConfigurations * sizeof (EFI_USB_CONFIG_DESCRIPTOR *));
if (Xhc->HcCParams.Data.Csz == 0) {
Status = XhcEvaluateContext (Xhc, SlotId, MaxPacket0);
} else {
@ -1087,7 +1087,7 @@ XhcControlTransfer (
//
// Default to use AlternateSetting 0 for all interfaces.
//
Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool (Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8));
Xhc->UsbDevContext[SlotId].ActiveAlternateSetting = AllocateZeroPool(Xhc->UsbDevContext[SlotId].ConfDesc[Index]->NumInterfaces * sizeof (UINT8));
}
} else if (((DescriptorType == USB_DESC_TYPE_HUB) ||
(DescriptorType == USB_DESC_TYPE_HUB_SUPER_SPEED)) && (*DataLength > 2)) {
@ -1486,7 +1486,7 @@ XhcAsyncInterruptTransfer (
goto ON_EXIT;
}
Data = AllocateZeroPool (DataLength);
Data = AllocateZeroPool(DataLength);
if (Data == NULL) {
// DEBUG ((EFI_D_ERROR, "XhcAsyncInterruptTransfer: failed to allocate buffer\n"));
@ -1855,7 +1855,7 @@ XhcCreateUsbHc (
UINT32 PageSize;
UINT16 ExtCapReg;
Xhc = AllocateZeroPool (sizeof (USB_XHCI_INSTANCE));
Xhc = AllocateZeroPool(sizeof (USB_XHCI_INSTANCE));
if (Xhc == NULL) {
return NULL;

View File

@ -32,7 +32,7 @@ XhcCreateCmdTrb (
{
URB *Urb;
Urb = AllocateZeroPool (sizeof (URB));
Urb = AllocateZeroPool(sizeof (URB));
if (Urb == NULL) {
return NULL;
}
@ -152,7 +152,7 @@ XhcCreateUrb (
EFI_STATUS Status;
URB *Urb;
Urb = AllocateZeroPool (sizeof (URB));
Urb = AllocateZeroPool(sizeof (URB));
if (Urb == NULL) {
return NULL;
}
@ -535,7 +535,7 @@ XhcInitSched (
//
// Allocate the buffer to record the Mapping for each scratch buffer in order to Unmap them
//
ScratchEntryMap = AllocateZeroPool (sizeof (UINTN) * MaxScratchpadBufs);
ScratchEntryMap = AllocateZeroPool(sizeof (UINTN) * MaxScratchpadBufs);
// ASSERT (ScratchEntryMap != NULL);
if (!ScratchEntryMap) {
return;
@ -545,7 +545,7 @@ XhcInitSched (
//
// Allocate the buffer to record the host address for each entry
//
ScratchEntry = AllocateZeroPool (sizeof (UINT64) * MaxScratchpadBufs);
ScratchEntry = AllocateZeroPool(sizeof (UINT64) * MaxScratchpadBufs);
// ASSERT (ScratchEntry != NULL);
if (!ScratchEntry) {
return;
@ -1622,7 +1622,7 @@ XhcMonitorAsyncRequests (
continue;
}
ProcBuf = AllocateZeroPool (Urb->Completed);
ProcBuf = AllocateZeroPool(Urb->Completed);
if (ProcBuf == NULL) {
XhcUpdateAsyncRequest (Xhc, Urb);
@ -2197,7 +2197,7 @@ XhcInitializeDeviceSlot (
//
// 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint.
//
EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING));
EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING));
Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing;
CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]);
//
@ -2422,7 +2422,7 @@ XhcInitializeDeviceSlot64 (
//
// 4) Allocate and initialize the Transfer Ring for the Default Control Endpoint.
//
EndpointTransferRing = AllocateZeroPool (sizeof (TRANSFER_RING));
EndpointTransferRing = AllocateZeroPool(sizeof (TRANSFER_RING));
Xhc->UsbDevContext[SlotId].EndpointTransferRing[0] = EndpointTransferRing;
CreateTransferRing(Xhc, TR_RING_TRB_NUMBER, (TRANSFER_RING *)Xhc->UsbDevContext[SlotId].EndpointTransferRing[0]);
//

View File

@ -162,7 +162,7 @@ StartApfsDriver (
//
// Patch verbose
//
NewSystemTable = (EFI_SYSTEM_TABLE *) AllocateZeroPool (gST->Hdr.HeaderSize);
NewSystemTable = (EFI_SYSTEM_TABLE *) AllocateZeroPool(gST->Hdr.HeaderSize);
if (NewSystemTable == NULL) {
gBS->UnloadImage (ImageHandle);
@ -340,7 +340,7 @@ LegacyApfsContainerScan (
}
Block = AllocateZeroPool ((UINTN)BlockSize);
Block = AllocateZeroPool((UINTN)BlockSize);
if (Block == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -381,7 +381,7 @@ LegacyApfsContainerScan (
// Reallocate Block size to contain all of partition entries.
//
FreePool(Block);
Block = AllocateZeroPool ((UINTN)PartitionNumber * PartitionEntrySize);
Block = AllocateZeroPool((UINTN)PartitionNumber * PartitionEntrySize);
if (Block == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -725,7 +725,7 @@ ApfsDriverLoaderStart (
MediaId = BlockIo->Media->MediaId;
}
ApfsBlock = AllocateZeroPool (2048);
ApfsBlock = AllocateZeroPool(2048);
if (ApfsBlock == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -803,7 +803,7 @@ ApfsDriverLoaderStart (
// ContainerSuperBlock (& EfiBootRecordBlockPtr ?) will not valid now
//
FreePool(ApfsBlock);
ApfsBlock = AllocateZeroPool (ApfsBlockSize);
ApfsBlock = AllocateZeroPool(ApfsBlockSize);
if (ApfsBlock == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -82,7 +82,7 @@ Returns:
{
FAT_ODIR *ODir;
ODir = AllocateZeroPool (sizeof (FAT_ODIR));
ODir = AllocateZeroPool(sizeof (FAT_ODIR));
if (ODir != NULL) {
//
// Initialize the directory entry list

View File

@ -465,7 +465,7 @@ Returns:
//
// This is a valid directory entry
//
DirEnt = AllocateZeroPool (sizeof (FAT_DIRENT));
DirEnt = AllocateZeroPool(sizeof (FAT_DIRENT));
if (DirEnt == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -1197,7 +1197,7 @@ Returns:
return EFI_NOT_FOUND;
}
ODir = OFile->ODir;
DirEnt = AllocateZeroPool (sizeof (FAT_DIRENT));
DirEnt = AllocateZeroPool(sizeof (FAT_DIRENT));
if (DirEnt == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -1307,7 +1307,7 @@ Returns:
//
// Open the directory entry
//
OFile = AllocateZeroPool (sizeof (FAT_OFILE));
OFile = AllocateZeroPool(sizeof (FAT_OFILE));
if (OFile == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -528,7 +528,7 @@ Returns:
//
// Allocate the Fat Cache buffer
//
CacheBuffer = AllocateZeroPool (FatCacheSize + DataCacheSize);
CacheBuffer = AllocateZeroPool(FatCacheSize + DataCacheSize);
if (CacheBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -52,7 +52,7 @@ Returns:
//
// Allocate a volume structure
//
Volume = AllocateZeroPool (sizeof (FAT_VOLUME));
Volume = AllocateZeroPool(sizeof (FAT_VOLUME));
if (Volume == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -42,7 +42,7 @@ Return:
{
FAT_TASK *Task;
Task = AllocateZeroPool (sizeof (*Task));
Task = AllocateZeroPool(sizeof (*Task));
if (Task != NULL) {
Task->Signature = FAT_TASK_SIGNATURE;
Task->IFile = IFile;
@ -398,7 +398,7 @@ Returns:
//
// Non-blocking access
//
Subtask = AllocateZeroPool (sizeof (*Subtask));
Subtask = AllocateZeroPool(sizeof (*Subtask));
if (Subtask == NULL) {
Status = EFI_OUT_OF_RESOURCES;
} else {

View File

@ -51,7 +51,7 @@ Returns:
//
// Allocate a new open instance
//
IFile = AllocateZeroPool (sizeof (FAT_IFILE));
IFile = AllocateZeroPool(sizeof (FAT_IFILE));
if (IFile == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -652,7 +652,7 @@ Returns:
BufferSize = FAT_MAX_ALLOCATE_SIZE;
}
ZeroBuffer = AllocateZeroPool (BufferSize);
ZeroBuffer = AllocateZeroPool(BufferSize);
if (ZeroBuffer == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -250,7 +250,7 @@ BiosKeyboardDriverBindingStart (
//
// Allocate the private device structure
//
BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_DEV));
BiosKeyboardPrivate = (BIOS_KEYBOARD_DEV *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_DEV));
if (NULL == BiosKeyboardPrivate) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -2341,7 +2341,7 @@ BiosKeyboardRegisterKeyNotify (
// Allocate resource to save the notification function
//
NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
NewNotify = (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (BIOS_KEYBOARD_CONSOLE_IN_EX_NOTIFY));
if (NewNotify == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;

View File

@ -632,7 +632,7 @@ BiosVideoChildHandleInstall (
//
// Allocate the private device structure for video device
//
BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool (sizeof (BIOS_VIDEO_DEV));
BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool(sizeof (BIOS_VIDEO_DEV));
if (NULL == BiosVideoPrivate) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;

View File

@ -637,7 +637,7 @@ BiosVideoChildHandleInstall (
//
// Allocate the private device structure for video device
//
BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool (sizeof (BIOS_VIDEO_DEV));
BiosVideoPrivate = (BIOS_VIDEO_DEV *) AllocateZeroPool(sizeof (BIOS_VIDEO_DEV));
if (NULL == BiosVideoPrivate) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;

View File

@ -687,7 +687,7 @@ DTInsertProperty (
//
// Insert Property Name.
//
CopyMem (Property->Name, AddPropertyName, AsciiStrLen (AddPropertyName));
CopyMem (Property->Name, AddPropertyName, AsciiStrLen(AddPropertyName));
//
// Insert Property Value Length.

View File

@ -351,8 +351,8 @@ BdsCreateLegacyBootOption (
//
UnicodeStrToAsciiStrS (BootDesc, HelpString, 100);
StringLen = AsciiStrLen (HelpString);
NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen);
StringLen = AsciiStrLen(HelpString);
NewBbsDevPathNode = AllocateZeroPool(sizeof (BBS_BBS_DEVICE_PATH) + StringLen);
if (NewBbsDevPathNode == NULL) {
return EFI_OUT_OF_RESOURCES;
}
@ -381,7 +381,7 @@ BdsCreateLegacyBootOption (
sizeof (BBS_TABLE) +
sizeof (UINT16);
Buffer = AllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool(BufferSize);
if (Buffer == NULL) {
FreePool(NewBbsDevPathNode);
FreePool(CurrentBbsDevPath);
@ -431,7 +431,7 @@ BdsCreateLegacyBootOption (
Buffer = NULL;
NewBootOrderList = AllocateZeroPool (*BootOrderListSize + sizeof (UINT16));
NewBootOrderList = AllocateZeroPool(*BootOrderListSize + sizeof (UINT16));
if (NULL == NewBootOrderList) {
FreePool(NewBbsDevPathNode);
FreePool(CurrentBbsDevPath);
@ -1025,7 +1025,7 @@ BdsCreateDevOrder (
//
// Create buffer to hold all boot device order
//
DevOrder = AllocateZeroPool (TotalSize);
DevOrder = AllocateZeroPool(TotalSize);
if (NULL == DevOrder) {
return EFI_OUT_OF_RESOURCES;
}
@ -1198,7 +1198,7 @@ BdsUpdateLegacyDevOrder (
TotalSize += (HeaderSize + NETCount * sizeof (UINT16));
TotalSize += (HeaderSize + BEVCount * sizeof (UINT16));
NewDevOrder = AllocateZeroPool (TotalSize);
NewDevOrder = AllocateZeroPool(TotalSize);
if (NULL == NewDevOrder) {
return EFI_OUT_OF_RESOURCES;
}
@ -2355,7 +2355,7 @@ BdsLibBootViaBootOption (
if (Option->DevicePath != NULL) {
FreePool(Option->DevicePath);
}
Option->DevicePath = AllocateZeroPool (GetDevicePathSize (DevicePath));
Option->DevicePath = AllocateZeroPool(GetDevicePathSize (DevicePath));
// ASSERT(Option->DevicePath != NULL);
if (!Option->DevicePath) {
return EFI_OUT_OF_RESOURCES;

View File

@ -1246,7 +1246,7 @@ Done:
return EFI_UNSUPPORTED;
}
LogoBlt = AllocateZeroPool ((UINTN)BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
LogoBlt = AllocateZeroPool((UINTN)BufferSize * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
if (LogoBlt == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -305,7 +305,7 @@ BdsLibRegisterNewOption (
OptionSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (String);
OptionSize += GetDevicePathSize (DevicePath);
OptionPtr = AllocateZeroPool (OptionSize);
OptionPtr = AllocateZeroPool(OptionSize);
// ASSERT (OptionPtr != NULL);
if (!OptionPtr) {
return EFI_OUT_OF_RESOURCES;
@ -396,7 +396,7 @@ BdsLibRegisterNewOption (
// Append the new option number to the original option order
//
OrderItemNum = (TempOptionSize / sizeof (UINT16)) + 1 ;
OptionOrderPtr = AllocateZeroPool ( OrderItemNum * sizeof (UINT16));
OptionOrderPtr = AllocateZeroPool( OrderItemNum * sizeof (UINT16));
// ASSERT (OptionOrderPtr!= NULL);
if (!OptionOrderPtr) {
return EFI_NOT_FOUND;
@ -693,7 +693,7 @@ BdsLibVariableToOption (
// The Console variables may have multiple device paths, so make
// an Entry for each one.
//
Option = AllocateZeroPool (sizeof (BDS_COMMON_OPTION));
Option = AllocateZeroPool(sizeof (BDS_COMMON_OPTION));
if (Option == NULL) {
FreePool(Variable);
return NULL;
@ -860,7 +860,7 @@ BdsLibGetVariableAndSize (
//
// Allocate the buffer to return
//
Buffer = AllocateZeroPool (BufferSize);
Buffer = AllocateZeroPool(BufferSize);
if (Buffer == NULL) {
*VariableSize = 0;
return NULL;
@ -1157,12 +1157,12 @@ SetupResetReminder (
if (IsResetReminderFeatureEnable ()) {
if (IsResetRequired ()) {
StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
StringBuffer1 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16));
// ASSERT (StringBuffer1 != NULL);
if (!StringBuffer1) {
return;
}
StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
StringBuffer2 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16));
// ASSERT (StringBuffer2 != NULL);
if (!StringBuffer2) {
FreePool(StringBuffer1);

View File

@ -90,7 +90,7 @@ CatPrint (
VA_LIST Args;
UINTN StringSize;
AppendStr = AllocateZeroPool (0x1000);
AppendStr = AllocateZeroPool(0x1000);
if (AppendStr == NULL) {
return Str->Str;
}
@ -100,7 +100,7 @@ CatPrint (
VA_END (Args);
if (NULL == Str->Str) {
StringSize = StrSize (AppendStr);
Str->Str = AllocateZeroPool (StringSize);
Str->Str = AllocateZeroPool(StringSize);
// ASSERT (Str->Str != NULL);
} else {
StringSize = StrSize (AppendStr);

View File

@ -289,7 +289,7 @@ WriteBootToOsPerformanceData (
&EndTicker)) != 0) {
NumPerfEntries++;
}
PerfEntriesAsDxeHandle = AllocateZeroPool (NumPerfEntries * sizeof (BOOLEAN));
PerfEntriesAsDxeHandle = AllocateZeroPool(NumPerfEntries * sizeof (BOOLEAN));
// ASSERT (PerfEntriesAsDxeHandle != NULL);
//

View File

@ -173,7 +173,7 @@ MachoGetClassNameFromSuperMetaClassPointer (
PrefixSize = L_STR_LEN (OSOBJ_PREFIX);
SuffixSize = L_STR_LEN (SMCP_TOKEN);
OutputSize = (AsciiStrLen (SmcpName) - PrefixSize - SuffixSize);
OutputSize = (AsciiStrLen(SmcpName) - PrefixSize - SuffixSize);
if ((OutputSize + 1) > ClassNameSize) {
return FALSE;
@ -288,7 +288,7 @@ MachoGetClassNameFromMetaClassPointer (
PrefixSize = L_STR_LEN (OSOBJ_PREFIX);
SuffixSize = L_STR_LEN (METACLASS_TOKEN);
ClassNameLength = (AsciiStrLen (MetaClassName) - PrefixSize - SuffixSize);
ClassNameLength = (AsciiStrLen(MetaClassName) - PrefixSize - SuffixSize);
if ((ClassNameLength + 1) > ClassNameSize) {
return FALSE;
}
@ -375,7 +375,7 @@ MachoGetMetaVtableNameFromClassName (
ASSERT (VtableNameSize > 0);
ASSERT (VtableName != NULL);
BodyLength = AsciiStrLen (ClassName);
BodyLength = AsciiStrLen(ClassName);
Result = OcOverflowTriAddUN (
L_STR_LEN (METACLASS_VTABLE_PREFIX),
@ -433,7 +433,7 @@ MachoGetFinalSymbolNameFromClassName (
ASSERT (FinalSymbolNameSize > 0);
ASSERT (FinalSymbolName != NULL);
BodyLength = AsciiStrLen (ClassName);
BodyLength = AsciiStrLen(ClassName);
Result = OcOverflowTriAddUN (
L_STR_LEN (OSOBJ_PREFIX),

View File

@ -123,12 +123,12 @@ MemLogInit (
//
// Set up and publish new MEM_LOG
//
mMemLog = AllocateZeroPool ( sizeof (MEM_LOG) );
mMemLog = AllocateZeroPool( sizeof (MEM_LOG) );
if (mMemLog == NULL) {
return EFI_OUT_OF_RESOURCES;
}
mMemLog->BufferSize = MEM_LOG_INITIAL_SIZE;
mMemLog->Buffer = AllocateZeroPool (MEM_LOG_INITIAL_SIZE);
mMemLog->Buffer = AllocateZeroPool(MEM_LOG_INITIAL_SIZE);
mMemLog->Cursor = mMemLog->Buffer;
mMemLog->Callback = NULL;

View File

@ -201,8 +201,8 @@ int EFIAPI tfp_sprintf(char *str, const char *fmt, ...) __printflike(2, 3);
#define memcpy(Dst, Src, Size) do { CopyMem(Dst, Src, Size); } while (0)
// Forcing VOID for those as the return types actually differ.
#define strlcpy(Dst, Src, Size) do { AsciiStrnCpyS (Dst, Size, Src, AsciiStrLen (Src)); } while (0)
#define strlcat(Dst, Src, Size) do { AsciiStrnCatS (Dst, Size, Src, AsciiStrLen (Src)); } while (0)
#define strlcpy(Dst, Src, Size) do { AsciiStrnCpyS (Dst, Size, Src, AsciiStrLen(Src)); } while (0)
#define strlcat(Dst, Src, Size) do { AsciiStrnCatS (Dst, Size, Src, AsciiStrLen(Src)); } while (0)
#endif // UBSAN_H

View File

@ -305,7 +305,7 @@ InitializeBootMenuData (
}
BootMenuData->TitleToken[0] = STRING_TOKEN (STR_BOOT_POPUP_MENU_TITLE_STRING);
BootMenuData->PtrTokens = AllocateZeroPool (BootOptionCount * sizeof (EFI_STRING_ID));
BootMenuData->PtrTokens = AllocateZeroPool(BootOptionCount * sizeof (EFI_STRING_ID));
ASSERT (BootMenuData->PtrTokens != NULL);
//
@ -430,7 +430,7 @@ BootMenuSelectItem (
//
PrintCol = StartCol + 1;
PrintRow = StartRow + TITLE_TOKEN_COUNT + 2;
String = AllocateZeroPool ((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16));
String = AllocateZeroPool((BootMenuData->MenuScreen.Width - 2) * sizeof (CHAR16));
ASSERT (String != NULL);
for (Index = 0; Index < BootMenuData->MenuScreen.Width - 3; Index++) {
String[Index] = 0x20;
@ -526,7 +526,7 @@ DrawBootPopupMenu (
//
// Draw the screen for title
//
String = AllocateZeroPool ((Width - 1) * sizeof (CHAR16));
String = AllocateZeroPool((Width - 1) * sizeof (CHAR16));
ASSERT (String != NULL);
for (Index = 0; Index < Width - 2; Index++) {
String[Index] = 0x20;

View File

@ -118,7 +118,7 @@ ReadFileToBuffer (
}
TempBufferSize = (UINTN) FileSize;
TempBuffer = AllocateZeroPool (TempBufferSize);
TempBuffer = AllocateZeroPool(TempBufferSize);
if (TempBuffer == NULL) {
ShellProtocol->CloseFile (Handle);
return EFI_OUT_OF_RESOURCES;

View File

@ -744,7 +744,7 @@ DumpCapsuleFromDisk (
goto Done;
}
FileInfoBuffer = AllocateZeroPool (sizeof (FileInfo) * FileCount);
FileInfoBuffer = AllocateZeroPool(sizeof (FileInfo) * FileCount);
if (FileInfoBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Done;
@ -1148,7 +1148,7 @@ DumpFmpData (
}
FmpImageInfoBuf = NULL;
FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize);
FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize);
if (FmpImageInfoBuf == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto EXIT;
@ -1323,7 +1323,7 @@ FindFmpFromImageTypeId (
}
FmpImageInfoBuf = NULL;
FmpImageInfoBuf = AllocateZeroPool (ImageInfoSize);
FmpImageInfoBuf = AllocateZeroPool(ImageInfoSize);
if (FmpImageInfoBuf == NULL) {
FreePool(HandleBuffer);
Print(L"Out of resource\n");

View File

@ -1052,10 +1052,10 @@ GetUefiMemoryProfileData (
goto Done;
}
Data = AllocateZeroPool ((UINTN) Size);
Data = AllocateZeroPool((UINTN) Size);
if (Data == NULL) {
Status = EFI_OUT_OF_RESOURCES;
Print (L"UefiMemoryProfile: AllocateZeroPool (0x%x) - %r\n", Size, Status);
Print (L"UefiMemoryProfile: AllocateZeroPool(0x%x) - %r\n", Size, Status);
return Status;
}
@ -1245,10 +1245,10 @@ GetSmramProfileData (
//
// Get Data
//
ProfileBuffer = AllocateZeroPool (ProfileSize);
ProfileBuffer = AllocateZeroPool(ProfileSize);
if (ProfileBuffer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
Print (L"SmramProfile: AllocateZeroPool (0x%x) for profile buffer - %r\n", ProfileSize, Status);
Print (L"SmramProfile: AllocateZeroPool(0x%x) for profile buffer - %r\n", ProfileSize, Status);
goto Done;
}

View File

@ -136,7 +136,7 @@ GetSmiHandlerProfileDatabase(
mSmiHandlerProfileDatabase = AllocateZeroPool(mSmiHandlerProfileDatabaseSize);
if (mSmiHandlerProfileDatabase == NULL) {
Status = EFI_OUT_OF_RESOURCES;
Print(L"SmiHandlerProfile: AllocateZeroPool (0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize, Status);
Print(L"SmiHandlerProfile: AllocateZeroPool(0x%x) for dump buffer - %r\n", mSmiHandlerProfileDatabaseSize, Status);
return ;
}

View File

@ -402,7 +402,7 @@ ConvertProcessorToString (
FreqMhz = 0;
}
DestMax = 0x20 / sizeof (CHAR16);
StringBuffer = AllocateZeroPool (0x20);
StringBuffer = AllocateZeroPool(0x20);
ASSERT (StringBuffer != NULL);
UnicodeValueToStringS (StringBuffer, sizeof (CHAR16) * DestMax, LEFT_JUSTIFY, FreqMhz / 1000, 3);
Index = StrnLenS (StringBuffer, DestMax);
@ -435,7 +435,7 @@ ConvertMemorySizeToString (
{
CHAR16 *StringBuffer;
StringBuffer = AllocateZeroPool (0x24);
StringBuffer = AllocateZeroPool(0x24);
ASSERT (StringBuffer != NULL);
UnicodeValueToStringS (StringBuffer, 0x24, LEFT_JUSTIFY, MemorySize, 10);
StrCatS (StringBuffer, 0x24 / sizeof (CHAR16), L" MB RAM");
@ -467,7 +467,7 @@ GetOptionalStringByIndex (
UINTN StrSize;
if (Index == 0) {
*String = AllocateZeroPool (sizeof (CHAR16));
*String = AllocateZeroPool(sizeof (CHAR16));
return EFI_SUCCESS;
}
@ -1091,9 +1091,9 @@ SetupResetReminder (
//
if (IsResetRequired ()) {
StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
StringBuffer1 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16));
ASSERT (StringBuffer1 != NULL);
StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
StringBuffer2 = AllocateZeroPool(MAX_STRING_LEN * sizeof (CHAR16));
ASSERT (StringBuffer2 != NULL);
StrCpyS (StringBuffer1, MAX_STRING_LEN, L"Configuration changed. Reset to apply it Now.");
StrCpyS (StringBuffer2, MAX_STRING_LEN, L"Press ENTER to reset");

View File

@ -303,7 +303,7 @@ UiCreateLanguageMenu (
//
// Allocate extra 1 as the end tag.
//
gLanguageToken = AllocateZeroPool ((OptionCount + 1) * sizeof (EFI_STRING_ID));
gLanguageToken = AllocateZeroPool((OptionCount + 1) * sizeof (EFI_STRING_ID));
ASSERT (gLanguageToken != NULL);
Status = gBS->LocateProtocol (&gEfiHiiStringProtocolGuid, NULL, (VOID **) &HiiString);
@ -317,7 +317,7 @@ UiCreateLanguageMenu (
StringSize = 0;
Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);
if (Status == EFI_BUFFER_TOO_SMALL) {
StringBuffer = AllocateZeroPool (StringSize);
StringBuffer = AllocateZeroPool(StringSize);
ASSERT (StringBuffer != NULL);
Status = HiiString->GetString (HiiString, Lang, HiiHandle, PRINTABLE_LANGUAGE_NAME_STRING_ID, StringBuffer, &StringSize, NULL);
ASSERT_EFI_ERROR(Status);
@ -587,7 +587,7 @@ UiListThirdPartyDrivers (
HiiHandles = HiiGetHiiHandles (NULL);
ASSERT (HiiHandles != NULL);
gHiiDriverList = AllocateZeroPool (UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE));
gHiiDriverList = AllocateZeroPool(UI_HII_DRIVER_LIST_SIZE * sizeof (UI_HII_DRIVER_INSTANCE));
ASSERT (gHiiDriverList != NULL);
DriverListPtr = gHiiDriverList;
CurrentSize = UI_HII_DRIVER_LIST_SIZE;

View File

@ -1594,7 +1594,7 @@ CreateNewDevice (
PEI_AHCI_ATA_DEVICE_DATA *DeviceData;
EFI_STATUS Status;
DeviceData = AllocateZeroPool (sizeof (PEI_AHCI_ATA_DEVICE_DATA));
DeviceData = AllocateZeroPool(sizeof (PEI_AHCI_ATA_DEVICE_DATA));
if (DeviceData == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -228,7 +228,7 @@ AtaAhciPeimEntry (
//
// Memory allocation for controller private data.
//
Private = AllocateZeroPool (sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA));
Private = AllocateZeroPool(sizeof (PEI_AHCI_CONTROLLER_PRIVATE_DATA));
if (Private == NULL) {
DEBUG ((
DEBUG_ERROR, "%a: Fail to allocate private data for Controller %d.\n",

View File

@ -1065,7 +1065,7 @@ CreateNewDeviceInfo (
{
EFI_ATA_DEVICE_INFO *DeviceInfo;
DeviceInfo = AllocateZeroPool (sizeof (EFI_ATA_DEVICE_INFO));
DeviceInfo = AllocateZeroPool(sizeof (EFI_ATA_DEVICE_INFO));
if (DeviceInfo == NULL) {
return EFI_OUT_OF_RESOURCES;
@ -1361,7 +1361,7 @@ AtaPassThruPassThru (
// For non-blocking mode, queue the Task into the list.
//
if (Event != NULL) {
Task = AllocateZeroPool (sizeof (ATA_NONBLOCK_TASK));
Task = AllocateZeroPool(sizeof (ATA_NONBLOCK_TASK));
if (Task == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -760,7 +760,7 @@ AtaBusDriverBindingStart (
// Check EFI_ALREADY_STARTED to reuse the original ATA_BUS_DRIVER_DATA.
//
if (Status != EFI_ALREADY_STARTED) {
AtaBusDriverData = AllocateZeroPool (sizeof (ATA_BUS_DRIVER_DATA));
AtaBusDriverData = AllocateZeroPool(sizeof (ATA_BUS_DRIVER_DATA));
if (AtaBusDriverData == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -808,7 +808,7 @@ AccessAtaDevice(
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
if (!IsListEmpty (&AtaDevice->AtaSubTaskList)) {
AtaTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_TASK));
AtaTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_TASK));
if (AtaTask == NULL) {
gBS->RestoreTPL (OldTpl);
return EFI_OUT_OF_RESOURCES;
@ -828,12 +828,12 @@ AccessAtaDevice(
gBS->RestoreTPL (OldTpl);
Token->TransactionStatus = EFI_SUCCESS;
EventCount = AllocateZeroPool (sizeof (UINTN));
EventCount = AllocateZeroPool(sizeof (UINTN));
if (EventCount == NULL) {
return EFI_OUT_OF_RESOURCES;
}
IsError = AllocateZeroPool (sizeof (BOOLEAN));
IsError = AllocateZeroPool(sizeof (BOOLEAN));
if (IsError == NULL) {
FreePool(EventCount);
return EFI_OUT_OF_RESOURCES;
@ -870,7 +870,7 @@ AccessAtaDevice(
SubTask = NULL;
SubEvent = NULL;
SubTask = AllocateZeroPool (sizeof (ATA_BUS_ASYN_SUB_TASK));
SubTask = AllocateZeroPool(sizeof (ATA_BUS_ASYN_SUB_TASK));
if (SubTask == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto EXIT;

View File

@ -635,7 +635,7 @@ I2cBusDriverStart (
//
// Allocate the I2C context structure for the current I2C controller
//
I2cBusContext = AllocateZeroPool (sizeof (I2C_BUS_CONTEXT));
I2cBusContext = AllocateZeroPool(sizeof (I2C_BUS_CONTEXT));
if (I2cBusContext == NULL) {
DEBUG ((EFI_D_ERROR, "I2cBus: there is no enough memory to allocate.\n"));
Status = EFI_OUT_OF_RESOURCES;

View File

@ -366,7 +366,7 @@ I2cHostDriverStart (
//
// Allocate the I2C Host Context structure
//
I2cHostContext = AllocateZeroPool (sizeof (I2C_HOST_CONTEXT));
I2cHostContext = AllocateZeroPool(sizeof (I2C_HOST_CONTEXT));
if (I2cHostContext == NULL) {
DEBUG ((EFI_D_ERROR, "I2cHost: there is no enough memory to allocate.\n"));
Status = EFI_OUT_OF_RESOURCES;
@ -989,7 +989,7 @@ I2cHostQueueRequest (
//
// Allocate the request structure
//
I2cRequest = AllocateZeroPool (sizeof (I2C_REQUEST));
I2cRequest = AllocateZeroPool(sizeof (I2C_REQUEST));
if (I2cRequest == NULL) {
DEBUG ((EFI_D_ERROR, "WARNING - Failed to allocate I2C_REQUEST!\n"));
return EFI_OUT_OF_RESOURCES;
@ -1008,7 +1008,7 @@ I2cHostQueueRequest (
// Copy request packet into private buffer, as RequestPacket may be freed during asynchronous transaction
//
RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION);
I2cRequest->RequestPacket = AllocateZeroPool (RequestPacketSize);
I2cRequest->RequestPacket = AllocateZeroPool(RequestPacketSize);
ASSERT (I2cRequest->RequestPacket != NULL);
CopyMem (I2cRequest->RequestPacket, RequestPacket, RequestPacketSize);

View File

@ -593,7 +593,7 @@ KeyboardRegisterKeyNotify (
//
// Allocate resource to save the notification function
//
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
NewNotify = (KEYBOARD_CONSOLE_IN_EX_NOTIFY *) AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_EX_NOTIFY));
if (NewNotify == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Exit;

View File

@ -240,7 +240,7 @@ KbdControllerDriverStart (
//
// Allocate private data
//
ConsoleIn = AllocateZeroPool (sizeof (KEYBOARD_CONSOLE_IN_DEV));
ConsoleIn = AllocateZeroPool(sizeof (KEYBOARD_CONSOLE_IN_DEV));
if (ConsoleIn == NULL) {
Status = EFI_OUT_OF_RESOURCES;
StatusCode = EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR;

View File

@ -204,7 +204,7 @@ PS2MouseDriverStart (
//
// Allocate private data
//
MouseDev = AllocateZeroPool (sizeof (PS2_MOUSE_DEV));
MouseDev = AllocateZeroPool(sizeof (PS2_MOUSE_DEV));
if (MouseDev == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -1525,7 +1525,7 @@ EhcCreateUsb2Hc (
USB2_HC_DEV *Ehc;
EFI_STATUS Status;
Ehc = AllocateZeroPool (sizeof (USB2_HC_DEV));
Ehc = AllocateZeroPool(sizeof (USB2_HC_DEV));
if (Ehc == NULL) {
return NULL;

View File

@ -190,7 +190,7 @@ EhcInitSched (
//
// Initialize the frame list entries then set the registers
//
Ehc->PeriodFrameHost = AllocateZeroPool (EHC_FRAME_LEN * sizeof (UINTN));
Ehc->PeriodFrameHost = AllocateZeroPool(EHC_FRAME_LEN * sizeof (UINTN));
if (Ehc->PeriodFrameHost == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ErrorExit;

View File

@ -559,7 +559,7 @@ EhcCreateUrb (
URB *Urb;
VOID *Map;
Urb = AllocateZeroPool (sizeof (URB));
Urb = AllocateZeroPool(sizeof (URB));
if (Urb == NULL) {
return NULL;

View File

@ -36,7 +36,7 @@ UsbHcAllocMemBlock (
PciIo = Pool->PciIo;
Block = AllocateZeroPool (sizeof (USBHC_MEM_BLOCK));
Block = AllocateZeroPool(sizeof (USBHC_MEM_BLOCK));
if (Block == NULL) {
return NULL;
}
@ -49,7 +49,7 @@ UsbHcAllocMemBlock (
Block->BufLen = EFI_PAGES_TO_SIZE (Pages);
Block->BitsLen = Block->BufLen / (USBHC_MEM_UNIT * 8);
Block->Bits = AllocateZeroPool (Block->BitsLen);
Block->Bits = AllocateZeroPool(Block->BitsLen);
if (Block->Bits == NULL) {
gBS->FreePool(Block);

View File

@ -323,7 +323,7 @@ PCheckDevice (
return EFI_UNSUPPORTED;
}
AcpiPtr = AllocateZeroPool (sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR));
AcpiPtr = AllocateZeroPool(sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR) * Index + sizeof (EFI_ACPI_END_TAG_DESCRIPTOR));
if (AcpiPtr == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -143,7 +143,7 @@ NonDiscoverablePciDeviceStart (
return EFI_OUT_OF_RESOURCES;
}
Dev = AllocateZeroPool (sizeof *Dev);
Dev = AllocateZeroPool(sizeof *Dev);
if (Dev == NULL) {
return EFI_OUT_OF_RESOURCES;
}

View File

@ -941,7 +941,7 @@ NvmExpressDriverBindingStart (
// Check EFI_ALREADY_STARTED to reuse the original NVME_CONTROLLER_PRIVATE_DATA.
//
if (Status != EFI_ALREADY_STARTED) {
Private = AllocateZeroPool (sizeof (NVME_CONTROLLER_PRIVATE_DATA));
Private = AllocateZeroPool(sizeof (NVME_CONTROLLER_PRIVATE_DATA));
if (Private == NULL) {
DEBUG ((EFI_D_ERROR, "NvmExpressDriverBindingStart: allocating pool for Nvme Private Data failed!\n"));

Some files were not shown because too many files have changed in this diff Show More