// 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