]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/GenericBdsLib/BdsMisc.c
1. Add some ASSERT();
[mirror_edk2.git] / MdeModulePkg / Library / GenericBdsLib / BdsMisc.c
index 9c426e543901ceb87dfbe095146bf3125675bda7..c96867877cd3bd68c0ba5536f66ed152cf4bb297 100644 (file)
@@ -59,8 +59,8 @@ BdsLibGetTimeout (
 }\r
 \r
 /**\r
-  The function will go through the driver optoin link list, load and start\r
-  every driver the driver optoin device path point to.\r
+  The function will go through the driver option link list, load and start\r
+  every driver the driver option device path point to.\r
 \r
   @param  BdsDriverLists        The header of the current driver option link list\r
 \r
@@ -166,7 +166,7 @@ BdsLibLoadDrivers (
 \r
 /**\r
   Get the Option Number that does not used.\r
-  Try to locate the specific option variable one by one untile find a free number.\r
+  Try to locate the specific option variable one by one utile find a free number.\r
 \r
   @param  VariableName          Indicate if the boot#### or driver#### option\r
 \r
@@ -204,7 +204,7 @@ BdsLibGetFreeOptionNumber (
     if (OptionBuffer == NULL) {\r
       break;\r
     }\r
-    Index ++;\r
+    Index++;\r
   } while (TRUE);\r
 \r
   return ((UINT16) Index);\r
@@ -508,11 +508,16 @@ BdsLibVariableToOption (
 \r
   Option->Signature   = BDS_LOAD_OPTION_SIGNATURE;\r
   Option->DevicePath  = AllocateZeroPool (GetDevicePathSize (DevicePath));\r
+  ASSERT(Option->DevicePath != NULL);\r
   CopyMem (Option->DevicePath, DevicePath, GetDevicePathSize (DevicePath));\r
+\r
   Option->Attribute   = Attribute;\r
   Option->Description = AllocateZeroPool (StrSize (Description));\r
+  ASSERT(Option->Description != NULL);\r
   CopyMem (Option->Description, Description, StrSize (Description));\r
+\r
   Option->LoadOptions = AllocateZeroPool (LoadOptionsSize);\r
+  ASSERT(Option->LoadOptions != NULL);\r
   CopyMem (Option->LoadOptions, LoadOptions, LoadOptionsSize);\r
   Option->LoadOptionsSize = LoadOptionsSize;\r
 \r
@@ -827,7 +832,8 @@ BdsLibOutputStrings (
       break;\r
     }\r
   }\r
-\r
+  \r
+  VA_END(Args);\r
   return Status;\r
 }\r
 \r