From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (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 F03DD81DD1 for ; Fri, 11 Nov 2016 04:45:06 -0800 (PST) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7267F12B6; Fri, 11 Nov 2016 12:45:10 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-102.phx2.redhat.com [10.3.116.102]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uABCj8ID021360; Fri, 11 Nov 2016 07:45:09 -0500 To: Jiaxin Wu , edk2-devel@ml01.01.org References: <1478841521-232036-1-git-send-email-jiaxin.wu@intel.com> <1478841521-232036-3-git-send-email-jiaxin.wu@intel.com> Cc: Ye Ting , Fu Siyuan , Santhapur Naveen From: Laszlo Ersek Message-ID: Date: Fri, 11 Nov 2016 13:45:08 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <1478841521-232036-3-git-send-email-jiaxin.wu@intel.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 11 Nov 2016 12:45:10 +0000 (UTC) Subject: Re: [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 12:45:07 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 11/11/16 06:18, Jiaxin Wu wrote: > 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 > Reviewed-by: Laszlo Ersek