From b1bb6f5961d82f30046e39e187a80556250f2bd1 Mon Sep 17 00:00:00 2001 From: Ruiyu Ni Date: Wed, 6 Apr 2016 14:36:58 +0800 Subject: [PATCH] MdeModulePkg/Bds: Fix a boot hang due to Ram Disk boot support Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Reviewed-by: Sunny Wang --- MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 5cae901d31..2eb8971ba0 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c @@ -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 -- 2.39.2