diff options
author | Ruiyu Ni <ruiyu.ni@intel.com> | 2016-04-06 14:36:58 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2016-04-06 14:49:25 +0800 |
commit | b1bb6f5961d82f30046e39e187a80556250f2bd1 (patch) | |
tree | 6949604b348b50dd2627a28c7c453d47ca4e4169 /MdeModulePkg/Library | |
parent | 213ae07750fc7532e8ba62a234e958388d1f0359 (diff) | |
download | edk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.zip edk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.tar.gz edk2-b1bb6f5961d82f30046e39e187a80556250f2bd1.tar.bz2 |
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/Library')
-rw-r--r-- | MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c b/MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c index 5cae901..2eb8971 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
|