summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2016-04-06 14:36:58 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-04-06 14:49:25 +0800
commitb1bb6f5961d82f30046e39e187a80556250f2bd1 (patch)
tree6949604b348b50dd2627a28c7c453d47ca4e4169 /MdeModulePkg
parent213ae07750fc7532e8ba62a234e958388d1f0359 (diff)
downloadedk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.tar.gz
edk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.tar.bz2
edk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.zip
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>
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c6
1 files changed, 5 insertions, 1 deletions
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