From b452e7a8246533a4923d54cc916bdf805f9543da Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Tue, 9 Jul 2024 14:23:42 +0200 Subject: [PATCH] fix(stm32mp1): skip OP-TEE header check if image base is NULL In bl2_plat_handle_post_image_load(), if the image_base of OP-TEE header image is 0, do not call optee_header_is_valid(). This can be the case when OP-TEE is not present in the FIP. Signed-off-by: Yann Gautier Change-Id: Ic2d014e59665c9efa33bbce1bf2eb3b66cd6fb26 --- plat/st/stm32mp1/bl2_plat_setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 2ade242b7..4f784220e 100644 --- a/plat/st/stm32mp1/bl2_plat_setup.c +++ b/plat/st/stm32mp1/bl2_plat_setup.c @@ -461,7 +461,8 @@ int bl2_plat_handle_post_image_load(unsigned int image_id) break; case BL32_IMAGE_ID: - if (optee_header_is_valid(bl_mem_params->image_info.image_base)) { + if ((bl_mem_params->image_info.image_base != 0UL) && + (optee_header_is_valid(bl_mem_params->image_info.image_base))) { image_info_t *paged_image_info = NULL; /* BL32 is OP-TEE header */