mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
e8d2a98052
commit
c8e342e00b
|
@ -366,6 +366,7 @@ Mtftp4Start (
|
|||
EFI_MTFTP4_CONFIG_DATA *Config;
|
||||
EFI_TPL OldTpl;
|
||||
EFI_STATUS Status;
|
||||
EFI_STATUS TokenStatus;
|
||||
|
||||
//
|
||||
// Validate the parameters
|
||||
|
@ -394,6 +395,8 @@ Mtftp4Start (
|
|||
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue