From 83d4a7e3552c184c18baa384487eedf10929cb3a Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Thu, 2 Sep 2010 12:59:59 +0100 Subject: [PATCH] IRQs: A bit of sanity when freeing Check the parameters... Signed-off-by: Michel Pollet --- simavr/sim/sim_irq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simavr/sim/sim_irq.c b/simavr/sim/sim_irq.c index 54e319b..92c2c17 100644 --- a/simavr/sim/sim_irq.c +++ b/simavr/sim/sim_irq.c @@ -62,6 +62,8 @@ static avr_irq_hook_t * _avr_alloc_irq_hook(avr_irq_t * irq) void avr_free_irq(avr_irq_t * irq, uint32_t count) { + if (!irq || !count) + return; for (int i = 0; i < count; i++) { // purge hooks avr_irq_hook_t *hook = irq->hook; -- 2.39.5