From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=fan.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (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 D7B7F220C2A6A for ; Sun, 11 Mar 2018 23:40:03 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 23:46:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,459,1515484800"; d="scan'208";a="24850985" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 11 Mar 2018 23:46:23 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 11 Mar 2018 23:46:23 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 11 Mar 2018 23:46:22 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.226]) by shsmsx102.ccr.corp.intel.com ([169.254.2.80]) with mapi id 14.03.0319.002; Mon, 12 Mar 2018 14:46:21 +0800 From: "Wang, Fan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" , "Fu, Siyuan" Thread-Topic: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status. Thread-Index: AQHTuajnqdxoMftHy0Gs379VtSgB+KPMKDdg Date: Mon, 12 Mar 2018 06:46:20 +0000 Message-ID: References: <20180312022150.952-1-jiaxin.wu@intel.com> In-Reply-To: <20180312022150.952-1-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 06:40:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Wang, Fan . Best Regards Fan -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiax= in Wu Sent: Monday, March 12, 2018 10:22 AM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Wang, Fan ; Fu, Siyua= n Subject: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return st= atus. The incorrect return status was caused by the commit of 39b0867d, which was= to resolve the token status error that does not compliance with spec defin= ition, but it results the protocol status not compliance with spec definiti= on. This patch is to resolve above issue. Cc: Wang Fan Cc: Fu Siyuan Cc: Ye Ting Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu --- .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 22 +++++++++++-------= ---- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeMod= ulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index d8c48ec8b2..065528c937 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -364,10 +364,11 @@ Mtftp4Start ( MTFTP4_PROTOCOL *Instance; EFI_MTFTP4_OVERRIDE_DATA *Override; EFI_MTFTP4_CONFIG_DATA *Config; EFI_TPL OldTpl; EFI_STATUS Status; + EFI_STATUS TokenStatus; =20 // // Validate the parameters // if ((This =3D=3D NULL) || (Token =3D=3D NULL) || (Token->Filename =3D=3D= NULL) || @@ -391,28 +392,28 @@ Mtftp4Start ( return EFI_INVALID_PARAMETER; } =20 Instance =3D MTFTP4_PROTOCOL_FROM_THIS (This); =20 - Status =3D EFI_SUCCESS; + Status =3D EFI_SUCCESS; + TokenStatus =3D EFI_SUCCESS; + =20 OldTpl =3D gBS->RaiseTPL (TPL_CALLBACK); =20 if (Instance->State !=3D MTFTP4_STATE_CONFIGED) { Status =3D EFI_NOT_STARTED; } =20 if (Instance->Operation !=3D 0) { Status =3D EFI_ACCESS_DENIED; } =20 - if (EFI_ERROR (Status)) { - gBS->RestoreTPL (OldTpl); - return Status; - } - if ((Token->OverrideData !=3D NULL) && !Mtftp4OverrideValid (Instance, T= oken->OverrideData)) { Status =3D EFI_INVALID_PARAMETER; + } + + if (EFI_ERROR (Status)) { gBS->RestoreTPL (OldTpl); return Status; } =20 // @@ -429,11 +430,11 @@ Mtftp4Start ( TRUE, &Instance->RequestOption ); =20 if (EFI_ERROR (Status)) { - Status =3D EFI_DEVICE_ERROR; + TokenStatus =3D EFI_DEVICE_ERROR; goto ON_ERROR; } } =20 // @@ -482,13 +483,12 @@ Mtftp4Start ( =20 // // Config the unicast UDP child to send initial request // Status =3D Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance); - if (EFI_ERROR (Status)) { - Status =3D EFI_DEVICE_ERROR; + TokenStatus =3D EFI_DEVICE_ERROR; goto ON_ERROR; } =20 // // Set initial status. @@ -503,11 +503,11 @@ Mtftp4Start ( } else { Status =3D Mtftp4RrqStart (Instance, Operation); } =20 if (EFI_ERROR (Status)) { - Status =3D EFI_DEVICE_ERROR; + TokenStatus =3D EFI_DEVICE_ERROR; goto ON_ERROR; } =20 if (Token->Event !=3D NULL) { gBS->RestoreTPL (OldTpl); @@ -524,11 +524,11 @@ Mtftp4Start ( =20 gBS->RestoreTPL (OldTpl); return Token->Status; =20 ON_ERROR: - Mtftp4CleanOperation (Instance, Status); + Mtftp4CleanOperation (Instance, TokenStatus); gBS->RestoreTPL (OldTpl); =20 return Status; } =20 -- 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel