Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
// 6. Adjust the different type memory page number just before booting\r
// and save the updated info into the variable for next boot to use\r
//\r
- BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);\r
+ if (RamDiskDevicePath == NULL) {\r
+ RamDiskSizeInPages = 0;\r
+ } else {\r
+ BmGetRamDiskMemoryInfo (RamDiskDevicePath, &RamDiskSizeInPages);\r
+ }\r
BmSetMemoryTypeInformationVariable (\r
(BOOLEAN) ((BootOption->Attributes & LOAD_OPTION_CATEGORY) == LOAD_OPTION_CATEGORY_BOOT),\r
RamDiskSizeInPages\r