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:
@ -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)
|
||||
|
Reference in New Issue
Block a user