From d3280beb700321b0ef47b4f61d84667ba501bc61 Mon Sep 17 00:00:00 2001 From: Juan Castillo Date: Thu, 5 Jun 2014 09:45:36 +0100 Subject: Rework incorrect use of assert() and panic() in codebase Assert a valid security state using the macro sec_state_is_valid(). Replace assert() with panic() in those cases that might arise because of runtime errors and not programming errors. Replace panic() with assert() in those cases that might arise because of programming errors. Fixes ARM-software/tf-issues#96 Change-Id: I51e9ef0439fd5ff5e0edfef49050b69804bf14d5 --- services/spd/tspd/tspd_common.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'services') diff --git a/services/spd/tspd/tspd_common.c b/services/spd/tspd/tspd_common.c index c497670..1b9609f 100644 --- a/services/spd/tspd/tspd_common.c +++ b/services/spd/tspd/tspd_common.c @@ -91,6 +91,7 @@ uint64_t tspd_synchronous_sp_entry(tsp_context_t *tsp_ctx) { uint64_t rc; + assert(tsp_ctx != NULL); assert(tsp_ctx->c_rt_ctx == 0); /* Apply the Secure EL1 system register context and switch to it */ @@ -117,6 +118,7 @@ uint64_t tspd_synchronous_sp_entry(tsp_context_t *tsp_ctx) ******************************************************************************/ void tspd_synchronous_sp_exit(tsp_context_t *tsp_ctx, uint64_t ret) { + assert(tsp_ctx != NULL); /* Save the Secure EL1 system register context */ assert(cm_get_context(SECURE) == &tsp_ctx->cpu_ctx); cm_el1_sysregs_context_save(SECURE); -- cgit v1.2.3