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 --- bl31/interrupt_mgmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bl31/interrupt_mgmt.c') diff --git a/bl31/interrupt_mgmt.c b/bl31/interrupt_mgmt.c index 2b0c7970..e595634e 100644 --- a/bl31/interrupt_mgmt.c +++ b/bl31/interrupt_mgmt.c @@ -107,7 +107,7 @@ uint32_t get_scr_el3_from_routing_model(uint32_t security_state) { uint32_t scr_el3; - assert(security_state <= NON_SECURE); + assert(sec_state_is_valid(security_state)); scr_el3 = intr_type_descs[INTR_TYPE_NS].scr_el3[security_state]; scr_el3 |= intr_type_descs[INTR_TYPE_S_EL1].scr_el3[security_state]; scr_el3 |= intr_type_descs[INTR_TYPE_EL3].scr_el3[security_state]; -- cgit v1.2.3