Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34535 )
Change subject: lib: Throw an error when ramdisk is present but initrd.size is 0 ......................................................................
Patch Set 11:
(2 comments)
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c File src/lib/fit_payload.c:
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@54 PS10, Line 54: region
Why region and not node?
I replaced with node. I believe the result doesn't change in both cases to use region->size and node->size, but using node->size is easier to understand.
https://review.coreboot.org/c/coreboot/+/34535/10/src/lib/fit_payload.c@78 PS10, Line 78: memcpy(dst, node->data, node->size);
I don't see how this would result in an error? true_size would still be non-zero, even if you didn't […]
I think the situation "region->size < node->size" never happens in the current implementation. It's possible that region->size is larger than node->size in unpack_fdt() and otherwise the sizes are same in fit_payload().