]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
Add some ASSERT()s.
[mirror_edk2.git] / MdeModulePkg / Library / GenericBdsLib / BdsBoot.c
index f170daab95b96058b50331df8a5d69f6ddffcd0b..953086c7d3b337458d0d83bb2565f13a5a510719 100644 (file)
@@ -89,8 +89,8 @@ BdsLibDoLegacyBoot (
 EFI_STATUS\r
 EFIAPI\r
 BdsLibBootViaBootOption (\r
-  IN  BDS_COMMON_OPTION             * Option,\r
-  IN  EFI_DEVICE_PATH_PROTOCOL      * DevicePath,\r
+  IN  BDS_COMMON_OPTION             *Option,\r
+  IN  EFI_DEVICE_PATH_PROTOCOL      *DevicePath,\r
   OUT UINTN                         *ExitDataSize,\r
   OUT CHAR16                        **ExitData OPTIONAL\r
   )\r
@@ -157,6 +157,7 @@ BdsLibBootViaBootOption (
         &Option->BootCurrent\r
         );\r
 \r
+  ASSERT (Option->DevicePath != NULL);\r
   if ((DevicePathType (Option->DevicePath) == BBS_DEVICE_PATH) &&\r
       (DevicePathSubType (Option->DevicePath) == BBS_BBS_DP)\r
     ) {\r
@@ -459,6 +460,7 @@ BdsExpandPartitionPartialDevicePathToFull (
         // If the user try to boot many OS in different HDs or partitions, in theory, the 'HDDP' variable maybe become larger and larger.\r
         //\r
         InstanceNum = 0;\r
+        ASSERT (CachedDevicePath != NULL);\r
         TempNewDevicePath = CachedDevicePath;\r
         while (!IsDevicePathEnd (TempNewDevicePath)) {\r
           TempNewDevicePath = NextDevicePathNode (TempNewDevicePath);\r
@@ -1225,6 +1227,7 @@ BdsLibBootNext (
     //\r
     UnicodeSPrint (Buffer, sizeof (Buffer), L"Boot%04x", *BootNext);\r
     BootOption = BdsLibVariableToOption (&TempList, Buffer);\r
+    ASSERT (BootOption != NULL);\r
     BdsLibConnectDevicePath (BootOption->DevicePath);\r
     BdsLibBootViaBootOption (BootOption, BootOption->DevicePath, &ExitDataSize, &ExitData);\r
   }\r