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>
This commit is contained in:
Patrick Georgi 2016-07-29 21:01:19 +02:00 committed by Martin Roth
parent e8f2ef51e1
commit 8260650cde
1 changed files with 4 additions and 1 deletions

View File

@ -761,7 +761,10 @@ static int list_cmos_entry(const cmos_entry_t * e, int show_name)
break; break;
case CMOS_OP_RESERVED: 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: case CMOS_AREA_OUT_OF_RANGE:
fprintf(stderr, fprintf(stderr,