bloblist: Zero records when adding

It is convenient for bloblist to zero out the contents of a records when
it is added. This saves the callers having to do it.

Update the API accordingly.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-01-27 08:49:52 -07:00
parent 02247c1887
commit b83994dec7
3 changed files with 30 additions and 4 deletions

View file

@ -73,6 +73,9 @@ static int bloblist_addrec(uint tag, int size, struct bloblist_rec **recp)
rec->hdr_size = sizeof(*rec);
rec->size = size;
rec->spare = 0;
/* Zero the record data */
memset(rec + 1, '\0', rec->size);
*recp = rec;
return 0;