create_fit() budgets a flat 596 bytes for the properties it writes, but one of them is the image name (named after the test itself), which is used twice and can cause libfdt run out of room and create_fit() return 0 if a new test with a longer name is added.
Size the buffer accounting for the name explicitly. Signed-off-by: Alexey Charkov <[email protected]> --- test/image/spl_load.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/image/spl_load.c b/test/image/spl_load.c index 94ac3a16b863..34ddc49d2463 100644 --- a/test/image/spl_load.c +++ b/test/image/spl_load.c @@ -163,7 +163,14 @@ static size_t start_fit(void *dst, size_t fit_size, size_t data_size, static size_t create_fit(void *dst, struct spl_image_info *spl_image, size_t *data_offset, bool external) { - size_t prop_size = 596, total_size = prop_size + spl_image->size; + /* + * The name goes in twice, as the description of both the image and the + * configuration, and for external data this budget is exact: it is the + * whole buffer start_fit() gets, and where the data then starts, which + * the loader expects 4-byte aligned. + */ + size_t prop_size = ALIGN(596 + 2 * strlen(spl_image->name), 4); + size_t total_size = prop_size + spl_image->size; void *payload = NULL; size_t off, size; -- 2.55.0
