1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 14:33:18 +02:00

layout: Make romentry.name a pointer

This should provide more flexibility while we don't have to allocate
256B extra per layout entry.

Change-Id: Ibb903113550ec13f43cbbd0a412c8f35fe1cf454
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/33515
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Nico Huber
2019-06-15 14:56:19 +02:00
parent 4f213285d7
commit 70461a9524
5 changed files with 39 additions and 17 deletions

View File

@ -1153,7 +1153,8 @@ int read_ich_descriptors_via_fdo(enum ich_chipset cs, void *spibar, struct ich_d
* @param len The length of the descriptor dump.
*
* @return 0 on success,
* 1 if the descriptor couldn't be parsed.
* 1 if the descriptor couldn't be parsed,
* 2 when out of memory.
*/
int layout_from_ich_descriptors(struct ich_layout *const layout, const void *const dump, const size_t len)
{
@ -1178,7 +1179,9 @@ int layout_from_ich_descriptors(struct ich_layout *const layout, const void *con
layout->entries[j].start = base;
layout->entries[j].end = limit;
layout->entries[j].included = false;
snprintf(layout->entries[j].name, sizeof(layout->entries[j].name), "%s", regions[i]);
layout->entries[j].name = strdup(regions[i]);
if (!layout->entries[j].name)
return 2;
++j;
}
layout->base.entries = layout->entries;