Commit 83d4a7e3552c184c18baa384487eedf10929cb3a
authorMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 11:59:59 +0000 (12:59 +0100)
committerMichel Pollet <buserror@gmail.com>
Thu, 2 Sep 2010 11:59:59 +0000 (12:59 +0100)
Check the parameters...

Signed-off-by: Michel Pollet <buserror@gmail.com>
simavr/sim/sim_irq.c

index 54e319b4f69880a195caa63c2ecd1ddb39af8c45..92c2c17b394b509986e12f29a696ad49f147cd3c 100644 (file)
@@ -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;