summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-01-21 18:40:05 +0000
committerlersek <lersek@Edk2>2016-01-21 18:40:05 +0000
commit8f2c09f8b2a8708db49e42bcac4cdfbccfa817d8 (patch)
tree328b35a87949783813be157ef2f2ce1aa404bc9a /ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
parent43da602cb4e14efa921a359afb9c4c06c7138eba (diff)
downloadedk2-8f2c09f8b2a8708db49e42bcac4cdfbccfa817d8.zip
edk2-8f2c09f8b2a8708db49e42bcac4cdfbccfa817d8.tar.gz
edk2-8f2c09f8b2a8708db49e42bcac4cdfbccfa817d8.tar.bz2
ShellPkg: BcfgDisplayDump(): accumulate errors
Don't exit the command immediately when a variable access fails; continue processing after printing the error message. Let the final return status reflect any encountered errors. This patch is intended as a functional improvement. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ryan Harkin <ryan.harkin@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19709 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c')
-rw-r--r--ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
index f5ae7bc..36d04d4 100644
--- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
+++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
@@ -1051,12 +1051,15 @@ BcfgDisplayDump(
UINTN LoopVar2;
CHAR16 *DevPathString;
VOID *DevPath;
+ UINTN Errors;
if (OrderCount == 0) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE), gShellBcfgHiiHandle, L"bcfg");
return (SHELL_SUCCESS);
}
+ Errors = 0;
+
for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
Buffer = NULL;
BufferSize = 0;
@@ -1083,7 +1086,8 @@ BcfgDisplayDump(
if (EFI_ERROR(Status) || Buffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_READ_FAIL), gShellBcfgHiiHandle, L"bcfg", VariableName);
- return (SHELL_INVALID_PARAMETER);
+ ++Errors;
+ goto Cleanup;
}
if ((*(UINT16*)(Buffer+4)) != 0) {
@@ -1120,6 +1124,7 @@ BcfgDisplayDump(
L"\r\n");
}
+Cleanup:
if (Buffer != NULL) {
FreePool(Buffer);
}
@@ -1130,7 +1135,7 @@ BcfgDisplayDump(
FreePool(DevPathString);
}
}
- return (SHELL_SUCCESS);
+ return (Errors > 0) ? SHELL_INVALID_PARAMETER : SHELL_SUCCESS;
}
/**