]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove ASSERT when failed to Get/Set “AttemptOrder” and “ClientId” variable.
authorFu Siyuan <siyuan.fu@intel.com>
Mon, 17 Mar 2014 05:32:32 +0000 (05:32 +0000)
committersfu5 <sfu5@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 17 Mar 2014 05:32:32 +0000 (05:32 +0000)
Removes RT attribute for “AttemptOrder” variable.
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Dong, Guo <guo.dong@intel.com>
Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15328 6f19259b-4bc3-4df7-8a09-765794883524

NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c
NetworkPkg/IScsiDxe/IScsiConfig.c
NetworkPkg/IScsiDxe/IScsiDriver.c

index 32247c927b0a63a6b89af29be80c24cb0950bd5e..7591bf56bab2bda372d1c1bfa97c75deabcc14c6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Dhcp6 support functions implementation.\r
 \r
-  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
@@ -157,7 +157,10 @@ Dhcp6GenerateClientId (
                   Duid->Length + 2,\r
                   (VOID *) Duid\r
                   );\r
-  ASSERT_EFI_ERROR (Status);\r
+  if (EFI_ERROR (Status)) {\r
+    FreePool (Duid);\r
+    return NULL;\r
+  }\r
 \r
   return Duid;\r
 }\r
index 2073f33191c2b17ca9d6e1a272e16389fab3bc1a..1d648f78bd4c0e2afdb9f58e1e4bf7584abf1808 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper functions for configuring or getting the parameters relating to iSCSI.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -784,7 +784,7 @@ IScsiConvertIfrNvDataToAttemptConfigData (
     Status = gRT->SetVariable (\r
                     L"AttemptOrder",\r
                     &gIScsiConfigGuid,\r
-                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                     AttemptConfigOrderSize,\r
                     AttemptConfigOrder\r
                     );\r
@@ -1246,8 +1246,7 @@ IScsiConfigDeleteAttempts (
     }\r
   }\r
 \r
-  Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS\r
-              | EFI_VARIABLE_NON_VOLATILE;\r
+  Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE;\r
 \r
   //\r
   // Update AttemptOrder in NVR.\r
@@ -1558,7 +1557,7 @@ IScsiConfigOrderAttempts (
   Status = gRT->SetVariable (\r
                   L"AttemptOrder",\r
                   &gIScsiConfigGuid,\r
-                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
+                  EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,\r
                   AttemptConfigOrderSize,\r
                   AttemptConfigOrderTmp\r
                   );\r
index 42ac8f0fe778e8b80c8d3335a10c6de0061d5ea3..8d1742455c2ca2cf17b0fe61ebea5ac0779f2965 100644 (file)
@@ -651,7 +651,9 @@ IScsiStart (
                            &gIScsiConfigGuid,\r
                            &AttemptConfigOrderSize\r
                            );\r
-    ASSERT (AttemptConfigOrder != NULL);\r
+    if (AttemptConfigOrder == NULL) {\r
+      goto ON_ERROR;\r
+    }\r
     for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) {\r
       if (AttemptConfigOrder[Index] == mPrivate->BootSelectedIndex ||\r
           AttemptConfigOrder[Index] == BootSelected) {\r
@@ -689,7 +691,9 @@ IScsiStart (
 \r
         goto ON_EXIT;\r
       } else {\r
-        ASSERT (AttemptConfigOrder[Index] == BootSelected);\r
+        if (AttemptConfigOrder[Index] != BootSelected) {\r
+          goto ON_ERROR;\r
+        }\r
         mPrivate->BootSelectedIndex = BootSelected;\r
         //\r
         // Clear the resource in ExistPrivate.\r