MdeModulePkg/Ip4Dxe: Correct the return status

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 <naveens@amiindia.co.in>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Jiaxin Wu 2016-11-11 12:52:49 +08:00
parent 818ba0ef81
commit 7278ce8cec
1 changed files with 3 additions and 7 deletions

View File

@ -1282,21 +1282,17 @@ Ip4Config2SetMaunualAddress (
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;
}
/**