summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index fc6e88721e..84638dab88 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -175,8 +175,11 @@ void *cbfs_simple_buffer_map(struct cbfs_simple_buffer *buffer,
"allocated=%zd, size=%zd, last_allocate=%zd\n",
offset, count, buffer->allocated, buffer->size,
buffer->last_allocate);
- if (buffer->allocated + count > buffer->size)
+ if (buffer->allocated + count > buffer->size) {
+ ERROR("simple_buffer: no room to map %zd bytes from %#zx\n",
+ count, offset);
return CBFS_MEDIA_INVALID_MAP_ADDRESS;
+ }
if (media->read(media, address, offset, count) != count) {
ERROR("simple_buffer: fail to read %zd bytes from 0x%zx\n",
count, offset);