mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
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
|
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH
|
||||||
//
|
//
|
||||||
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);
|
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.StartingAddress = BaseAddress;
|
||||||
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;
|
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;
|
||||||
} else {
|
} else {
|
||||||
@ -520,6 +524,10 @@ ProduceFVBProtocolOnBuffer (
|
|||||||
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH
|
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH
|
||||||
//
|
//
|
||||||
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);
|
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 (
|
CopyGuid (
|
||||||
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName,
|
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName,
|
||||||
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)
|
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)
|
||||||
|
@ -935,7 +935,7 @@ ProcessFvFile (
|
|||||||
BuildFvHob (
|
BuildFvHob (
|
||||||
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
|
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
|
||||||
FvImageInfo.FvSize
|
FvImageInfo.FvSize
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Makes the encapsulated volume show up in DXE phase to skip processing of
|
// Makes the encapsulated volume show up in DXE phase to skip processing of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user