]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Bds: Fix a boot hang due to Ram Disk boot support
authorRuiyu Ni <ruiyu.ni@intel.com>
Wed, 6 Apr 2016 06:36:58 +0000 (14:36 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 6 Apr 2016 06:49:25 +0000 (14:49 +0800)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c

index 5cae901d31aed25831d97ed34b55c31375178cb3..2eb8971ba0f6b709bdbc6967458be152aff57b2a 100644 (file)
@@ -1702,7 +1702,11 @@ EfiBootManagerBoot (
   // 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