Skip to content

Commit

Permalink
MdeModulePkg/Bds: Fix a boot hang due to Ram Disk boot support
Browse files Browse the repository at this point in the history
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
  • Loading branch information
niruiyu committed Apr 6, 2016
1 parent 213ae07 commit b1bb6f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b1bb6f5

Please sign in to comment.