From nobody Wed May 8 13:42:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1520821315891110.61638856282434; Sun, 11 Mar 2018 19:21:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 16DF622283512; Sun, 11 Mar 2018 19:15:34 -0700 (PDT) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 70A9622135D4A for ; Sun, 11 Mar 2018 19:15:33 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2018 19:21:53 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.126]) by fmsmga006.fm.intel.com with ESMTP; 11 Mar 2018 19:21:52 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,459,1515484800"; d="scan'208";a="210729136" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Mon, 12 Mar 2018 10:21:50 +0800 Message-Id: <20180312022150.952-1-jiaxin.wu@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [edk2] [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: , Cc: Ye Ting , Wang Fan , Fu Siyuan MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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. 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 Reviewed-by: Fu Siyuan Reviewed-by: Wang, Fan . --- .../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 --=20 2.16.2.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel