git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7861
6f19259b-4bc3-4df7-8a09-
765794883524
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH\r
//\r
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);\r
// FV does not contains extension header, then produce MEMMAP_DEVICE_PATH\r
//\r
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_MEMMAP_DEVICE_PATH), &mFvMemmapDevicePathTemplate);\r
+ if (FvbDev->DevicePath == NULL) {\r
+ FreePool (FvbDev);\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress;\r
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;\r
} else {\r
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.StartingAddress = BaseAddress;\r
((FV_MEMMAP_DEVICE_PATH *) FvbDev->DevicePath)->MemMapDevPath.EndingAddress = BaseAddress + FwVolHeader->FvLength - 1;\r
} else {\r
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH\r
//\r
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);\r
// FV contains extension header, then produce MEDIA_FW_VOL_DEVICE_PATH\r
//\r
FvbDev->DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocateCopyPool (sizeof (FV_PIWG_DEVICE_PATH), &mFvPIWGDevicePathTemplate);\r
+ if (FvbDev->DevicePath == NULL) {\r
+ FreePool (FvbDev);\r
+ return EFI_OUT_OF_RESOURCES;\r
+ }\r
CopyGuid (\r
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName, \r
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)\r
CopyGuid (\r
&((FV_PIWG_DEVICE_PATH *)FvbDev->DevicePath)->FvDevPath.FvName, \r
(GUID *)(UINTN)(BaseAddress + FwVolHeader->ExtHeaderOffset)\r
BuildFvHob (\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
FvImageInfo.FvSize\r
BuildFvHob (\r
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
FvImageInfo.FvSize\r
\r
//\r
// Makes the encapsulated volume show up in DXE phase to skip processing of\r
\r
//\r
// Makes the encapsulated volume show up in DXE phase to skip processing of\r