summaryrefslogtreecommitdiff
path: root/util/nvramtool/cli/nvramtool.c
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2016-07-29 21:01:19 +0200
committerMartin Roth <martinroth@google.com>2016-07-31 19:07:43 +0200
commit8260650cde3db83e8faf9dad66eac3dc5f0937eb (patch)
tree708a8b790f93acc9df3194314f2bb7b05f1b7b10 /util/nvramtool/cli/nvramtool.c
parente8f2ef51e1809b8c20d87049586935a7f3dd90a7 (diff)
nvramtool: Don't consider reserved regions to be "out of range"
Reserved regions showed different behavior for debug and regular builds. Debug output was unfriendly, regular was wrong. Print a proper error message and exit instead. Change-Id: I9842ff61f7d554800e2041e8c4c607f22b2df79f Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Found-by: Coverity Scan #1287076 Reviewed-on: https://review.coreboot.org/15968 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'util/nvramtool/cli/nvramtool.c')
-rw-r--r--util/nvramtool/cli/nvramtool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c
index ac13acc450..7f5fba8199 100644
--- a/util/nvramtool/cli/nvramtool.c
+++ b/util/nvramtool/cli/nvramtool.c
@@ -761,7 +761,10 @@ static int list_cmos_entry(const cmos_entry_t * e, int show_name)
break;
case CMOS_OP_RESERVED:
- BUG();
+ fprintf(stderr,
+ "%s: Cannot access reserved CMOS area (for %s).\n",
+ prog_name, e->name);
+ return 1;
case CMOS_AREA_OUT_OF_RANGE:
fprintf(stderr,