From 4096bd66c7af0a5661c7926460f2a2ca4162388d Mon Sep 17 00:00:00 2001 From: Charlie Bareham Date: Wed, 7 Aug 2024 17:29:34 +0100 Subject: [PATCH] fix(sdei): fix a crash when attempting to bind more events than are available You can only bind a limited number of events in each range. If you attempt to bind more, it was crashing. This patch makes it return an error code instead. Change-Id: Ib19f0f0780959ded244d45349d9d6c8607255c15 Signed-off-by: Charlie Bareham --- services/std_svc/sdei/sdei_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/std_svc/sdei/sdei_main.c b/services/std_svc/sdei/sdei_main.c index 59a1673df..01cc13150 100644 --- a/services/std_svc/sdei/sdei_main.c +++ b/services/std_svc/sdei/sdei_main.c @@ -744,7 +744,9 @@ static int sdei_interrupt_bind(unsigned int intr_num) return SDEI_ENOMEM; /* The returned mapping must be dynamic */ - assert(is_map_dynamic(map)); + if (!is_map_dynamic(map)) { + return SDEI_ENOMEM; + } /* * We cannot assert for bound maps here, as we might be racing