diff options
author | Jiaxin Wu <jiaxin.wu@intel.com> | 2018-03-12 08:50:41 +0800 |
---|---|---|
committer | Jiaxin Wu <jiaxin.wu@intel.com> | 2018-03-14 08:39:18 +0800 |
commit | ee528d435670cf59629bd555250a9eb8ce2ff0ae (patch) | |
tree | 2e81c53e85f53f631a1a59d55a05dc3a6a8910fd | |
parent | 4ad2e3319804ddbe418545adb6882ef6ca0492f8 (diff) | |
download | edk2-ee528d435670cf59629bd555250a9eb8ce2ff0ae.tar.gz |
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>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wang, Fan <fan.wang@intel.com>
(cherry picked from commit c8e342e00b7e9f1a7b592a5eb1e589635e484660)
-rw-r--r-- | MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 22 |
1 files 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 @@ -366,6 +366,7 @@ Mtftp4Start ( EFI_MTFTP4_CONFIG_DATA *Config;
EFI_TPL OldTpl;
EFI_STATUS Status;
+ EFI_STATUS TokenStatus;
//
// Validate the parameters
@@ -393,7 +394,9 @@ Mtftp4Start ( 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) {
@@ -404,13 +407,11 @@ Mtftp4Start ( 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;
}
@@ -431,7 +432,7 @@ Mtftp4Start ( );
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
}
@@ -484,9 +485,8 @@ 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;
}
@@ -505,7 +505,7 @@ Mtftp4Start ( }
if (EFI_ERROR (Status)) {
- Status = EFI_DEVICE_ERROR;
+ TokenStatus = EFI_DEVICE_ERROR;
goto ON_ERROR;
}
@@ -526,7 +526,7 @@ Mtftp4Start ( return Token->Status;
ON_ERROR:
- Mtftp4CleanOperation (Instance, Status);
+ Mtftp4CleanOperation (Instance, TokenStatus);
gBS->RestoreTPL (OldTpl);
return Status;
|