ShellPkg/TftpDynamicCommand: Return proper status

Tftp command always returned "SHELL_NOT_FOUND" which is treated as an
error by callers. Add missing line to clean the ShellStatus on
successful operation. If operation has failed, return the error status
if available.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1487

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Reviewed-by: Songpeng Li <songpeng.li@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
This commit is contained in:
Vladimir Olovyannikov via edk2-devel 2019-01-23 10:26:15 -08:00 committed by Jaben Carsey
parent 9084239f34
commit 83463154af
1 changed files with 6 additions and 0 deletions

View File

@ -548,6 +548,8 @@ RunTftp (
goto NextHandle;
}
ShellStatus = SHELL_SUCCESS;
NextHandle:
CloseProtocolAndDestroyServiceChild (
@ -575,6 +577,10 @@ RunTftp (
FreePool (Handles);
}
if ((ShellStatus != SHELL_SUCCESS) && (EFI_ERROR(Status))) {
ShellStatus = Status & ~MAX_BIT;
}
return ShellStatus;
}