From: Fu Siyuan Date: Mon, 17 Mar 2014 05:32:32 +0000 (+0000) Subject: Remove ASSERT when failed to Get/Set “AttemptOrder” and “ClientId” variable. X-Git-Tag: edk2-stable201903~11637 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;ds=inline;h=9c12f2d77fe8ac958e6da4ceb92378227dd6c676;p=mirror_edk2.git Remove ASSERT when failed to Get/Set “AttemptOrder” and “ClientId” variable. Removes RT attribute for “AttemptOrder” variable. Signed-off-by: Fu Siyuan Reviewed-by: Dong, Guo Reviewed-by: Yao, Jiewen 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 --- diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index 32247c927b..7591bf56ba 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -1,7 +1,7 @@ /** @file Dhcp6 support functions implementation. - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -157,7 +157,10 @@ Dhcp6GenerateClientId ( Duid->Length + 2, (VOID *) Duid ); - ASSERT_EFI_ERROR (Status); + if (EFI_ERROR (Status)) { + FreePool (Duid); + return NULL; + } return Duid; } diff --git a/NetworkPkg/IScsiDxe/IScsiConfig.c b/NetworkPkg/IScsiDxe/IScsiConfig.c index 2073f33191..1d648f78bd 100644 --- a/NetworkPkg/IScsiDxe/IScsiConfig.c +++ b/NetworkPkg/IScsiDxe/IScsiConfig.c @@ -1,7 +1,7 @@ /** @file Helper functions for configuring or getting the parameters relating to iSCSI. -Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -784,7 +784,7 @@ IScsiConvertIfrNvDataToAttemptConfigData ( Status = gRT->SetVariable ( L"AttemptOrder", &gIScsiConfigGuid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, AttemptConfigOrderSize, AttemptConfigOrder ); @@ -1246,8 +1246,7 @@ IScsiConfigDeleteAttempts ( } } - Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS - | EFI_VARIABLE_NON_VOLATILE; + Attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE; // // Update AttemptOrder in NVR. @@ -1558,7 +1557,7 @@ IScsiConfigOrderAttempts ( Status = gRT->SetVariable ( L"AttemptOrder", &gIScsiConfigGuid, - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, + EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE, AttemptConfigOrderSize, AttemptConfigOrderTmp ); diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index 42ac8f0fe7..8d1742455c 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -651,7 +651,9 @@ IScsiStart ( &gIScsiConfigGuid, &AttemptConfigOrderSize ); - ASSERT (AttemptConfigOrder != NULL); + if (AttemptConfigOrder == NULL) { + goto ON_ERROR; + } for (Index = 0; Index < AttemptConfigOrderSize / sizeof (UINT8); Index++) { if (AttemptConfigOrder[Index] == mPrivate->BootSelectedIndex || AttemptConfigOrder[Index] == BootSelected) { @@ -689,7 +691,9 @@ IScsiStart ( goto ON_EXIT; } else { - ASSERT (AttemptConfigOrder[Index] == BootSelected); + if (AttemptConfigOrder[Index] != BootSelected) { + goto ON_ERROR; + } mPrivate->BootSelectedIndex = BootSelected; // // Clear the resource in ExistPrivate.