mirror of https://github.com/acidanthera/audk.git
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:
parent
1e34ba7e0c
commit
18fcd6a70c
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue