MdeModulePkg/Bds: Fix a boot hang due to Ram Disk boot support

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
This commit is contained in:
Ruiyu Ni 2016-04-06 14:36:58 +08:00
parent 213ae07750
commit b1bb6f5961
1 changed files with 5 additions and 1 deletions

View File

@ -1702,7 +1702,11 @@ EfiBootManagerBoot (
// 6. Adjust the different type memory page number just before booting
// and save the updated info into the variable for next boot to use
//
BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);
if (RamDiskDevicePath == NULL) {
RamDiskSizeInPages = 0;
} else {
BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);
}
BmSetMemoryTypeInformationVariable (
(BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT),
RamDiskSizeInPages