From 83463154afc699c8116a42df9184b034056c7b33 Mon Sep 17 00:00:00 2001 From: Vladimir Olovyannikov via edk2-devel Date: Wed, 23 Jan 2019 10:26:15 -0800 Subject: [PATCH] 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 Reviewed-by: Songpeng Li Reviewed-by: Jaben Carsey --- ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c index ba753a279b..88e3988a55 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/Tftp.c @@ -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; } -- 2.39.2