From 8260650cde3db83e8faf9dad66eac3dc5f0937eb Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 29 Jul 2016 21:01:19 +0200 Subject: 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 Found-by: Coverity Scan #1287076 Reviewed-on: https://review.coreboot.org/15968 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Duncan Laurie --- util/nvramtool/cli/nvramtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util') 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, -- cgit v1.2.3