Skip to content

Commit 84be446

Browse files
nordic-krchrugeGerritsen
authored andcommitted
[nrf fromtree] boards: nrf*_bsim: Detect attempt to configure not existing int
Similar to 923d4fb. Prevent overrunning the irq vector table. This is not happening today in tree, but coverity thinks it does. Checking for it to prevent it is not a bad idea anyhow, so let's do it. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit cd23fdf)
1 parent 4fe50d7 commit 84be446

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

boards/native/nrf_bsim/irq_handler.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ void posix_isr_declare(unsigned int irq_p, int flags, void isr_p(const void *),
278278
*/
279279
void posix_irq_priority_set(unsigned int irq, unsigned int prio, uint32_t flags)
280280
{
281+
if (irq >= NHW_INTCTRL_MAX_INTLINES) {
282+
bs_trace_error_time_line("Attempted to configure not existent interrupt %u\n",
283+
irq);
284+
return;
285+
}
281286
hw_irq_ctrl_prio_set(CONFIG_NATIVE_SIMULATOR_MCU_N, irq, prio);
282287
}
283288

0 commit comments

Comments
 (0)