From: Michel Pollet Date: Thu, 2 Sep 2010 11:59:59 +0000 (+0100) Subject: IRQs: A bit of sanity when freeing X-Git-Tag: v1.0a6~11 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=83d4a7e3552c184c18baa384487eedf10929cb3a;p=sx%2Fsimavr.git IRQs: A bit of sanity when freeing Check the parameters... Signed-off-by: Michel Pollet --- 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;