X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FLibrary%2FUefiBootManagerLib%2FBmBoot.c;h=2eb8971ba0f6b709bdbc6967458be152aff57b2a;hp=5cae901d31aed25831d97ed34b55c31375178cb3;hb=b1bb6f5961d82f30046e39e187a80556250f2bd1;hpb=213ae07750fc7532e8ba62a234e958388d1f0359 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