This patch made the following change:
* DataItem->Status should be updated to the status code.
* Data should not be freed if EFI_NOT_READY returned.

Cc: Santhapur Naveen <nave...@amiindia.co.in>
Cc: Laszlo Ersek <ler...@redhat.com>
Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
---
 MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c 
b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
index 5b01b35..88ead9d 100644
--- a/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
+++ b/MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Config2Impl.c
@@ -1280,25 +1280,21 @@ Ip4Config2SetMaunualAddress (
   DataItem->DataSize = DataSize;
   DataItem->Status   = EFI_NOT_READY;
 
   IpSb->Reconfig = TRUE;
   Status = Ip4Config2SetDefaultAddr (IpSb, StationAddress, SubnetMask);
-  if (EFI_ERROR (Status)) {
-    goto ON_EXIT;
-  }  
 
-  DataItem->Status = EFI_SUCCESS;   
+  DataItem->Status = Status; 
 
-ON_EXIT:
-  if (EFI_ERROR (DataItem->Status)) {
+  if (EFI_ERROR (DataItem->Status) && DataItem->Status != EFI_NOT_READY) {
     if (Ptr != NULL) {
       FreePool (Ptr);
     }
     DataItem->Data.Ptr = NULL; 
   }
 
-  return EFI_SUCCESS;
+  return Status;
 }
 
 /**
   The work function is to set the gateway addresses manually for the EFI IPv4 
   network stack that is running on the communication device that this EFI IPv4 
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to