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>
This commit is contained in:
Simon Glass
2021-07-05 16:32:55 -06:00
parent faff554292
commit 1f618d528e
2 changed files with 24 additions and 1 deletions

View File

@@ -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);