]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add some ASSERT()s.
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jan 2009 06:34:35 +0000 (06:34 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 19 Jan 2009 06:34:35 +0000 (06:34 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7302 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/GenericBdsLib/BdsBoot.c
MdeModulePkg/Library/GenericBdsLib/BdsMisc.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
index c96867877cd3bd68c0ba5536f66ed152cf4bb297..5779aec725c66acc9904598d1fedcb88fa4ce62b 100644 (file)
@@ -270,7 +270,7 @@ BdsLibRegisterNewOption (
                     &gEfiGlobalVariableGuid,\r
                     &TempOptionSize\r
                     );\r
-\r
+  ASSERT (TempOptionPtr != NULL);\r
   //\r
   // Compare with current option variable\r
   //\r
@@ -600,6 +600,7 @@ BdsLibBuildOptionFromVar (
     }\r
 \r
     Option              = BdsLibVariableToOption (BdsCommonOptionList, OptionName);\r
+    ASSERT (Option != NULL);\r
     Option->BootCurrent = OptionOrder[Index];\r
 \r
   }\r