The board_fit_image_post_process() function assumes that all TIFSSTUB images appear at the end of the image_os_match[] array by using the condition:
i > IMAGE_ID_DM_FW However, this assumption breaks when new image types are appended to the enum and the array, causing unintended image types to match this condition and having their buffer sizes incorrectly set to 0 with: *p_size = 0 To avoid this issue, replace the range-based check with an explicit match for TIFSSTUB image IDs. Signed-off-by: Beleswar Padhi <b-pa...@ti.com> --- v2: Changelog: 1. New patch. Fixes condition to allow new images to be added at the end of the enum. arch/arm/mach-k3/r5/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-k3/r5/common.c b/arch/arm/mach-k3/r5/common.c index da5184e615c..81fc67a0023 100644 --- a/arch/arm/mach-k3/r5/common.c +++ b/arch/arm/mach-k3/r5/common.c @@ -365,7 +365,9 @@ void board_fit_image_post_process(const void *fit, int node, void **p_image, } } - if (i < IMAGE_AMT && i > IMAGE_ID_DM_FW) { + if (i < IMAGE_AMT && + (i == IMAGE_ID_TIFSSTUB_HS || i == IMAGE_ID_TIFSSTUB_FS || + i == IMAGE_ID_T)) { int device_type = get_device_type(); if ((device_type == K3_DEVICE_TYPE_HS_SE && -- 2.34.1