From: Graeme Russ Date: Mon, 8 Dec 2008 09:04:51 +0000 (+1100) Subject: Fixed off-by-one errors in lib_m68k/interrupts.c X-Git-Tag: v2009.03-rc1~184 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=626d07348e5f9f302f4ea182161a89f7362a0488;p=u-boot Fixed off-by-one errors in lib_m68k/interrupts.c Signed-off-by: Graeme Russ --- diff --git a/lib_m68k/interrupts.c b/lib_m68k/interrupts.c index 2dc079beea..133494f6dc 100644 --- a/lib_m68k/interrupts.c +++ b/lib_m68k/interrupts.c @@ -61,7 +61,7 @@ static __inline__ void set_sr (unsigned short sr) */ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg) { - if ((vec < 0) || (vec > NR_IRQS)) { + if ((vec < 0) || (vec >= NR_IRQS)) { printf ("irq_install_handler: wrong interrupt vector %d\n", vec); return; @@ -73,7 +73,7 @@ void irq_install_handler (int vec, interrupt_handler_t * handler, void *arg) void irq_free_handler (int vec) { - if ((vec < 0) || (vec > NR_IRQS)) { + if ((vec < 0) || (vec >= NR_IRQS)) { return; }