From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E718081E8E for ; Thu, 10 Nov 2016 21:18:44 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 10 Nov 2016 21:18:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,620,1473145200"; d="scan'208";a="1067039985" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.64]) by fmsmga001.fm.intel.com with ESMTP; 10 Nov 2016 21:18:47 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Santhapur Naveen , Laszlo Ersek , Ye Ting , Fu Siyuan Date: Fri, 11 Nov 2016 13:18:41 +0800 Message-Id: <1478841521-232036-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1478841521-232036-1-git-send-email-jiaxin.wu@intel.com> References: <1478841521-232036-1-git-send-email-jiaxin.wu@intel.com> Subject: [PATCH v2 2/2] MdeModulePkg/Ip4Dxe: Correct the return status X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2016 05:18:45 -0000 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 Cc: Laszlo Ersek Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu --- 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