summaryrefslogtreecommitdiff
path: root/common/bloblist.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-05 16:32:55 -0600
committerSimon Glass <sjg@chromium.org>2021-07-21 10:27:34 -0600
commit1f618d528e234d2b7b0047750284dd531f5d718f (patch)
tree7c07e13de91bfa3e6d6d418f5dda739ef401e1b3 /common/bloblist.c
parentfaff554292824037c4f098020ddbc8d979900415 (diff)
bloblist: Correct condition in bloblist_addrec()
It is possible to add a blob that ends at the end of the bloblist, but at present this is not supported. Fix it and add a regression test for this case. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/bloblist.c')
-rw-r--r--common/bloblist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/bloblist.c b/common/bloblist.c
index bb49ecab92..1290fff850 100644
--- a/common/bloblist.c
+++ b/common/bloblist.c
@@ -118,7 +118,7 @@ static int bloblist_addrec(uint tag, int size, int align,
/* Calculate the new allocated total */
new_alloced = data_start + ALIGN(size, align);
- if (new_alloced >= hdr->size) {
+ if (new_alloced > hdr->size) {
log(LOGC_BLOBLIST, LOGL_ERR,
"Failed to allocate %x bytes size=%x, need size=%x\n",
size, hdr->size, new_alloced);