[U-Boot] [PATCH] Fixed off-by-one errors in lib_m68k/interrupts.c

Graeme Russ graeme.russ at gmail.com
Mon Dec 8 10:04:51 CET 2008


Signed-off-by: Graeme Russ <graeme.russ at gmail.com>
---
 lib_m68k/interrupts.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib_m68k/interrupts.c b/lib_m68k/interrupts.c
index 2dc079b..133494f 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;
 	}
 
-- 
1.6.0.2.GIT



More information about the U-Boot mailing list