From e97e413fb5b4f9dd72b76cdfd6cfa4713b9232aa Mon Sep 17 00:00:00 2001 From: Sandrine Bailleux Date: Wed, 30 Nov 2016 11:24:01 +0000 Subject: [PATCH] Check Trusty is present during the SPD's initialization Add a debug assertion in the initialization function of Trusty's SPD to check for the presence of Trusty. If Trusty is absent then the SPD's setup function already detects it and returns an error code so the init function will never been called. Therefore, a debug assertion is enough to catch this improbable error case. Change-Id: Id20013e9291cdeef7827b919de2a22455f6cd9f9 Signed-off-by: Sandrine Bailleux --- services/spd/trusty/trusty.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/spd/trusty/trusty.c b/services/spd/trusty/trusty.c index 4c688caa..78a68ba0 100644 --- a/services/spd/trusty/trusty.c +++ b/services/spd/trusty/trusty.c @@ -236,7 +236,12 @@ static int32_t trusty_init(void) int reg_width = GET_RW(read_ctx_reg(get_el3state_ctx(&ctx->cpu_ctx), CTX_SPSR_EL3)); + /* + * Get information about the Trusty image. Its absence is a critical + * failure. + */ ep_info = bl31_plat_get_next_image_ep_info(SECURE); + assert(ep_info); cm_el1_sysregs_context_save(NON_SECURE); -- 2.30.2