]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
Add #include Acpi.h so the ACPI 3.0 Table Revision define is available.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiConfig.c
index 0025f24bc1c9703947f2c6ab2bea9c66b55f0aa0..59840f7f060309e98712aad6f1af159684549524 100644 (file)
@@ -359,9 +359,10 @@ IScsiFormExtractConfig (
   ISCSI_FORM_CALLBACK_INFO         *Private;\r
   EFI_HII_CONFIG_ROUTING_PROTOCOL  *HiiConfigRouting;\r
 \r
-  if (Request == NULL) {\r
+  if (Request == NULL || Progress == NULL || Results == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+  *Progress = Request;\r
 \r
   if (!mIScsiDeviceListUpdated) {\r
     //\r
@@ -426,7 +427,7 @@ IScsiFormExtractConfig (
 \r
   @retval EFI_SUCCESS             The results have been distributed or are\r
                                   awaiting distribution.  \r
-  @retval EFI_OUT_OF_MEMORY       Not enough memory to store the\r
+  @retval EFI_OUT_OF_RESOURCES    Not enough memory to store the\r
                                   parts of the results that must be\r
                                   stored awaiting possible future\r
                                   protocols.\r
@@ -444,6 +445,20 @@ IScsiFormRouteConfig (
   OUT EFI_STRING                             *Progress\r
   )\r
 {\r
+  if (Configuration == NULL || Progress == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  //\r
+  // Check routing data in <ConfigHdr>.\r
+  // Note: if only one Storage is used, then this checking could be skipped.\r
+  //\r
+  if (!HiiIsConfigHdrMatch (Configuration, &mVendorGuid, mVendorStorageName)) {\r
+    *Progress = Configuration;\r
+    return EFI_NOT_FOUND;\r
+  }\r
+\r
+  *Progress = Configuration + StrLen (Configuration);\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -505,8 +520,10 @@ IScsiFormCallback (
   //\r
   // Retrive uncommitted data from Browser\r
   //\r
-  IfrNvData = (ISCSI_CONFIG_IFR_NVDATA *) HiiGetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA));\r
-  if (IfrNvData == NULL) {\r
+  IfrNvData = AllocateZeroPool (sizeof (ISCSI_CONFIG_IFR_NVDATA));\r
+  ASSERT (IfrNvData != NULL);\r
+  if (!HiiGetBrowserData (&mVendorGuid, mVendorStorageName, sizeof (ISCSI_CONFIG_IFR_NVDATA), (UINT8 *) IfrNvData)) {\r
+    FreePool (IfrNvData);\r
     return EFI_NOT_FOUND;\r
   }\r
   \r