Add check to the allocated pool.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7861 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2009-03-11 02:53:15 +00:00
parent 1e34ba7e0c
commit 18fcd6a70c
2 changed files with 9 additions and 1 deletions

View File

@ -513,6 +513,10 @@ ProduceFVBProtocolOnBuffer (
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH
//
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
if (FvbDev->DevicePath == NULL) {
FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES;
}
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress;
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;
} else {
@ -520,6 +524,10 @@ ProduceFVBProtocolOnBuffer (
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH
//
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
if (FvbDev->DevicePath == NULL) {
FreePool (FvbDev);
return EFI_OUT_OF_RESOURCES;
}
CopyGuid (
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName,
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)

View File

@ -935,7 +935,7 @@ ProcessFvFile (
BuildFvHob (
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
FvImageInfo.FvSize
);
);
//
// Makes the encapsulated volume show up in DXE phase to skip processing of