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.93; helo=mga11.intel.com; envelope-from=siyuan.fu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 B05E8220C2A6A for ; Sun, 11 Mar 2018 23:34:06 -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 fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 23:40:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,459,1515484800"; d="scan'208";a="24850107" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga006.jf.intel.com with ESMTP; 11 Mar 2018 23:40:26 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 11 Mar 2018 23:40:26 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 11 Mar 2018 23:40:25 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.235]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.226]) with mapi id 14.03.0319.002; Mon, 12 Mar 2018 14:40:24 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Wang, Fan" , "Ye, Ting" Thread-Topic: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status. Thread-Index: AQHTuajsItPwEQspWkqGgl9tfMpDjKPMJqUw Date: Mon, 12 Mar 2018 06:40:24 +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-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNGFhYjc1ODktMjRhOS00MzA0LWIxZmItYjlmODVmZGYzOTI3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJUZEJOWVVzU1B4dk05clU1WEx2c1I5Zjd1NmhvTzNDNlFYbVd1NnB5STBoU1NrMlZ6WTYreWUrSmlBRExlME41In0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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:34:07 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan > -----Original Message----- > From: Wu, Jiaxin > Sent: Monday, March 12, 2018 10:22 AM > To: edk2-devel@lists.01.org > Cc: Wang, Fan ; Fu, Siyuan ; Ye, > Ting > Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status. >=20 > 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 > definition, but it results the protocol status not compliance with spec > definition. >=20 > This patch is to resolve above issue. >=20 > 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(-) >=20 > diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c > b/MdeModulePkg/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; > + > 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, > Token->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