diff options
| author | Francois Berder <[email protected]> | 2025-11-11 11:37:35 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-22 08:48:13 -0600 |
| commit | 8385ecc8eff91c45700040efbb08cba2ce6d3659 (patch) | |
| tree | 9f3f145fa845627b9c70a7748ea6aff9337fb29c | |
| parent | 74c68b54977447e97b98b12c3ca7fe2a7f4a3803 (diff) | |
upl: Fix buf array size
Size of array buf was incorrect due to sizeof returning the
size of an integer (typically 32 bits) instead of a u64 type
(64 bits). Hence, buf array was shorter than expected.
Signed-off-by: Francois Berder <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | boot/upl_write.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/boot/upl_write.c b/boot/upl_write.c index 7d637c15ba0..4185e59becf 100644 --- a/boot/upl_write.c +++ b/boot/upl_write.c @@ -301,7 +301,7 @@ static int add_upl_memory(const struct upl *upl, ofnode root) for (i = 0; i < upl->mem.count; i++) { const struct upl_mem *mem = alist_get(&upl->mem, i, struct upl_mem); - char buf[mem->region.count * sizeof(64) * 2]; + char buf[mem->region.count * sizeof(u64) * 2]; const struct memregion *first; char name[26]; int ret, len; @@ -354,7 +354,7 @@ static int add_upl_memmap(const struct upl *upl, ofnode root) for (i = 0; i < upl->memmap.count; i++) { const struct upl_memmap *memmap = alist_get(&upl->memmap, i, struct upl_memmap); - char buf[memmap->region.count * sizeof(64) * 2]; + char buf[memmap->region.count * sizeof(u64) * 2]; const struct memregion *first; char name[26]; int ret, len; @@ -411,7 +411,7 @@ static int add_upl_memres(const struct upl *upl, ofnode root, for (i = 0; i < upl->memres.count; i++) { const struct upl_memres *memres = alist_get(&upl->memres, i, struct upl_memres); - char buf[memres->region.count * sizeof(64) * 2]; + char buf[memres->region.count * sizeof(u64) * 2]; const struct memregion *first; char name[26]; int ret, len; |
