summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/cbfs_core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/cbfs_core.c b/src/lib/cbfs_core.c
index 264d9a8f24..19cf83a41d 100644
--- a/src/lib/cbfs_core.c
+++ b/src/lib/cbfs_core.c
@@ -167,6 +167,11 @@ struct cbfs_file *cbfs_get_file(struct cbfs_media *media, const char *name)
file_ptr = media->map(media, offset,
file_offset + file_len);
media->close(media);
+ if (file_ptr == CBFS_MEDIA_INVALID_MAP_ADDRESS) {
+ ERROR("ERROR: Mapping %s failed (insufficient "
+ "buffer space?).\n", file_name);
+ return NULL;
+ }
return file_ptr;
} else {
DEBUG(" (unmatched file @0x%x: %s)\n", offset,