* [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
@ 2018-03-12 2:21 Jiaxin Wu
2018-03-12 6:40 ` Fu, Siyuan
2018-03-12 6:46 ` Wang, Fan
0 siblings, 2 replies; 3+ messages in thread
From: Jiaxin Wu @ 2018-03-12 2:21 UTC (permalink / raw)
To: edk2-devel; +Cc: Wang Fan, Fu Siyuan, Ye Ting
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 <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
.../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
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;
//
// Validate the parameters
//
if ((This == NULL) || (Token == NULL) || (Token->Filename == NULL) ||
@@ -391,28 +392,28 @@ Mtftp4Start (
return EFI_INVALID_PARAMETER;
}
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ TokenStatus = EFI_SUCCESS;
+
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State != MTFTP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
}
if (Instance->Operation != 0) {
Status = EFI_ACCESS_DENIED;
}
- if (EFI_ERROR (Status)) {
- gBS->RestoreTPL (OldTpl);
- return Status;
- }
-
if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance, Token->OverrideData)) {
Status = EFI_INVALID_PARAMETER;
+ }
+
+ if (EFI_ERROR (Status)) {
gBS->RestoreTPL (OldTpl);
return Status;
}
//
@@ -429,11 +430,11 @@ Mtftp4Start (
TRUE,
&Instance->RequestOption
);
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
}
//
@@ -482,13 +483,12 @@ Mtftp4Start (
//
// Config the unicast UDP child to send initial request
//
Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
-
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
//
// Set initial status.
@@ -503,11 +503,11 @@ Mtftp4Start (
} else {
Status = Mtftp4RrqStart (Instance, Operation);
}
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
if (Token->Event != NULL) {
gBS->RestoreTPL (OldTpl);
@@ -524,11 +524,11 @@ Mtftp4Start (
gBS->RestoreTPL (OldTpl);
return Token->Status;
ON_ERROR:
- Mtftp4CleanOperation (Instance, Status);
+ Mtftp4CleanOperation (Instance, TokenStatus);
gBS->RestoreTPL (OldTpl);
return Status;
}
--
2.16.2.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
2018-03-12 2:21 [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status Jiaxin Wu
@ 2018-03-12 6:40 ` Fu, Siyuan
2018-03-12 6:46 ` Wang, Fan
1 sibling, 0 replies; 3+ messages in thread
From: Fu, Siyuan @ 2018-03-12 6:40 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Wang, Fan, Ye, Ting
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
> -----Original Message-----
> From: Wu, Jiaxin
> Sent: Monday, March 12, 2018 10:22 AM
> To: edk2-devel@lists.01.org
> Cc: Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Ye,
> Ting <ting.ye@intel.com>
> Subject: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
>
> 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 <fan.wang@intel.com>
> Cc: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
> ---
> .../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 22 +++++++++++------
> -----
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> 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;
>
> //
> // Validate the parameters
> //
> if ((This == NULL) || (Token == NULL) || (Token->Filename == NULL) ||
> @@ -391,28 +392,28 @@ Mtftp4Start (
> return EFI_INVALID_PARAMETER;
> }
>
> Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
>
> - Status = EFI_SUCCESS;
> + Status = EFI_SUCCESS;
> + TokenStatus = EFI_SUCCESS;
> +
> OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
>
> if (Instance->State != MTFTP4_STATE_CONFIGED) {
> Status = EFI_NOT_STARTED;
> }
>
> if (Instance->Operation != 0) {
> Status = EFI_ACCESS_DENIED;
> }
>
> - if (EFI_ERROR (Status)) {
> - gBS->RestoreTPL (OldTpl);
> - return Status;
> - }
> -
> if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance,
> Token->OverrideData)) {
> Status = EFI_INVALID_PARAMETER;
> + }
> +
> + if (EFI_ERROR (Status)) {
> gBS->RestoreTPL (OldTpl);
> return Status;
> }
>
> //
> @@ -429,11 +430,11 @@ Mtftp4Start (
> TRUE,
> &Instance->RequestOption
> );
>
> if (EFI_ERROR (Status)) {
> - Status = EFI_DEVICE_ERROR;
> + TokenStatus = EFI_DEVICE_ERROR;
> goto ON_ERROR;
> }
> }
>
> //
> @@ -482,13 +483,12 @@ Mtftp4Start (
>
> //
> // Config the unicast UDP child to send initial request
> //
> Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
> -
> if (EFI_ERROR (Status)) {
> - Status = EFI_DEVICE_ERROR;
> + TokenStatus = EFI_DEVICE_ERROR;
> goto ON_ERROR;
> }
>
> //
> // Set initial status.
> @@ -503,11 +503,11 @@ Mtftp4Start (
> } else {
> Status = Mtftp4RrqStart (Instance, Operation);
> }
>
> if (EFI_ERROR (Status)) {
> - Status = EFI_DEVICE_ERROR;
> + TokenStatus = EFI_DEVICE_ERROR;
> goto ON_ERROR;
> }
>
> if (Token->Event != NULL) {
> gBS->RestoreTPL (OldTpl);
> @@ -524,11 +524,11 @@ Mtftp4Start (
>
> gBS->RestoreTPL (OldTpl);
> return Token->Status;
>
> ON_ERROR:
> - Mtftp4CleanOperation (Instance, Status);
> + Mtftp4CleanOperation (Instance, TokenStatus);
> gBS->RestoreTPL (OldTpl);
>
> return Status;
> }
>
> --
> 2.16.2.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
2018-03-12 2:21 [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status Jiaxin Wu
2018-03-12 6:40 ` Fu, Siyuan
@ 2018-03-12 6:46 ` Wang, Fan
1 sibling, 0 replies; 3+ messages in thread
From: Wang, Fan @ 2018-03-12 6:46 UTC (permalink / raw)
To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting, Fu, Siyuan
Reviewed-by: Wang, Fan <fan.wang@intel.com>.
Best Regards
Fan
-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Monday, March 12, 2018 10:22 AM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Wang, Fan <fan.wang@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>
Subject: [edk2] [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status.
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 <fan.wang@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
---
.../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
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;
//
// Validate the parameters
//
if ((This == NULL) || (Token == NULL) || (Token->Filename == NULL) || @@ -391,28 +392,28 @@ Mtftp4Start (
return EFI_INVALID_PARAMETER;
}
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ TokenStatus = EFI_SUCCESS;
+
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
if (Instance->State != MTFTP4_STATE_CONFIGED) {
Status = EFI_NOT_STARTED;
}
if (Instance->Operation != 0) {
Status = EFI_ACCESS_DENIED;
}
- if (EFI_ERROR (Status)) {
- gBS->RestoreTPL (OldTpl);
- return Status;
- }
-
if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance, Token->OverrideData)) {
Status = EFI_INVALID_PARAMETER;
+ }
+
+ if (EFI_ERROR (Status)) {
gBS->RestoreTPL (OldTpl);
return Status;
}
//
@@ -429,11 +430,11 @@ Mtftp4Start (
TRUE,
&Instance->RequestOption
);
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
}
//
@@ -482,13 +483,12 @@ Mtftp4Start (
//
// Config the unicast UDP child to send initial request
//
Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);
-
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
//
// Set initial status.
@@ -503,11 +503,11 @@ Mtftp4Start (
} else {
Status = Mtftp4RrqStart (Instance, Operation);
}
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
if (Token->Event != NULL) {
gBS->RestoreTPL (OldTpl);
@@ -524,11 +524,11 @@ Mtftp4Start (
gBS->RestoreTPL (OldTpl);
return Token->Status;
ON_ERROR:
- Mtftp4CleanOperation (Instance, Status);
+ Mtftp4CleanOperation (Instance, TokenStatus);
gBS->RestoreTPL (OldTpl);
return Status;
}
--
2.16.2.windows.1
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-12 6:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-12 2:21 [Patch] MdeModulePkg/Mtftp4Dxe: Fix the incorrect return status Jiaxin Wu
2018-03-12 6:40 ` Fu, Siyuan
2018-03-12 6:46 ` Wang, Fan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox