* This function sets returned status as token status and signal token
when error occurs, and it results token status not compliance with
spec definition. This patch fixed this issue.
* This function restore Tpl twice when Mtftp4WrqStart() returns an
error, this patch fixed this issue.
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wang Fan <fan.wang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Interface routine for Mtftp4.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
Interface routine for Mtftp4.\r
\r
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>\r
-Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
+ if ((Token->OverrideData != NULL) && !Mtftp4OverrideValid (Instance, Token->OverrideData)) {\r
+ Status = EFI_INVALID_PARAMETER;\r
+ gBS->RestoreTPL (OldTpl);\r
+ return Status;\r
+ }\r
+\r
//\r
// Set the Operation now to prevent the application start other\r
// operations.\r
//\r
// Set the Operation now to prevent the application start other\r
// operations.\r
Instance->Operation = Operation;\r
Override = Token->OverrideData;\r
\r
Instance->Operation = Operation;\r
Override = Token->OverrideData;\r
\r
- if ((Override != NULL) && !Mtftp4OverrideValid (Instance, Override)) {\r
- Status = EFI_INVALID_PARAMETER;\r
- goto ON_ERROR;\r
- }\r
-\r
if (Token->OptionCount != 0) {\r
Status = Mtftp4ParseOption (\r
Token->OptionList,\r
if (Token->OptionCount != 0) {\r
Status = Mtftp4ParseOption (\r
Token->OptionList,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
);\r
\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);\r
\r
if (EFI_ERROR (Status)) {\r
Status = Mtftp4ConfigUnicastPort (Instance->UnicastPort, Instance);\r
\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
Status = Mtftp4RrqStart (Instance, Operation);\r
}\r
\r
Status = Mtftp4RrqStart (Instance, Operation);\r
}\r
\r
- gBS->RestoreTPL (OldTpl);\r
-\r
if (EFI_ERROR (Status)) {\r
if (EFI_ERROR (Status)) {\r
+ Status = EFI_DEVICE_ERROR;\r
goto ON_ERROR;\r
}\r
\r
if (Token->Event != NULL) {\r
goto ON_ERROR;\r
}\r
\r
if (Token->Event != NULL) {\r
+ gBS->RestoreTPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
return EFI_SUCCESS;\r
}\r
\r
This->Poll (This);\r
}\r
\r
This->Poll (This);\r
}\r
\r
+ gBS->RestoreTPL (OldTpl);\r
return Token->Status;\r
\r
ON_ERROR:\r
return Token->Status;\r
\r
ON_ERROR:\r