Author: stepan Date: Tue Mar 30 11:59:23 2010 New Revision: 5327 URL: https://tracker.coreboot.org/trac/coreboot/changeset/5327
Log: build_opt_tbl: error instead of null pointer access if no checksum is defined. xe7501devkit: If cmos.layout is used, there must be a checksum.
Signed-off-by: Stefan Reinauer stepan@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/src/mainboard/intel/xe7501devkit/cmos.layout trunk/util/options/build_opt_tbl.c
Modified: trunk/src/mainboard/intel/xe7501devkit/cmos.layout ============================================================================== --- trunk/src/mainboard/intel/xe7501devkit/cmos.layout Tue Mar 30 11:57:28 2010 (r5326) +++ trunk/src/mainboard/intel/xe7501devkit/cmos.layout Tue Mar 30 11:59:23 2010 (r5327) @@ -52,4 +52,5 @@ checksums
# Checksum FROM bit-location TO bit-location STORE AT bit-location -#checksum 1024 1047 1048 +checksum 1024 1047 1048 +
Modified: trunk/util/options/build_opt_tbl.c ============================================================================== --- trunk/util/options/build_opt_tbl.c Tue Mar 30 11:57:28 2010 (r5326) +++ trunk/util/options/build_opt_tbl.c Tue Mar 30 11:59:23 2010 (r5327) @@ -608,9 +608,17 @@ fprintf(fp, "#define CMOS_VLEN_%s %d\n", ce->name, ce->length); } - fprintf(fp, "\n#define LB_CKS_RANGE_START %d\n", cs->range_start / 8); - fprintf(fp, "#define LB_CKS_RANGE_END %d\n", cs->range_end / 8); - fprintf(fp, "#define LB_CKS_LOC %d\n", cs->location / 8); + + if (cs != NULL) { + fprintf(fp, "\n#define LB_CKS_RANGE_START %d\n", cs->range_start / 8); + fprintf(fp, "#define LB_CKS_RANGE_END %d\n", cs->range_end / 8); + fprintf(fp, "#define LB_CKS_LOC %d\n", cs->location / 8); + } else { + fprintf(stderr, "Error - No checksums defined.\n"); + fclose(fp); + unlink(tempfilename); + exit(1); + } fclose(fp);
UNLINK_IF_NECESSARY(header);