Browse Source

下标越界判断有误(interrupt.c)

Eziotao 2 years ago
parent
commit
870bf84964
1 changed files with 3 additions and 3 deletions
  1. 3 3
      bsp/allwinner_tina/libcpu/interrupt.c

+ 3 - 3
bsp/allwinner_tina/libcpu/interrupt.c

@@ -70,7 +70,7 @@ void rt_hw_interrupt_init(void)
 void rt_hw_interrupt_mask(int vector)
 {
     int index;
-    if ((vector < 0) || (vector > INTERRUPTS_MAX))
+    if ((vector < 0) || (vector >= INTERRUPTS_MAX))
     {
         return;
     }
@@ -89,7 +89,7 @@ void rt_hw_interrupt_mask(int vector)
 void rt_hw_interrupt_umask(int vector)
 {
     int index;
-    if ((vector < 0) || (vector > INTERRUPTS_MAX))
+    if ((vector < 0) || (vector >= INTERRUPTS_MAX))
     {
         return;
     }
@@ -114,7 +114,7 @@ rt_isr_handler_t rt_hw_interrupt_install(int vector, rt_isr_handler_t handler,
     rt_isr_handler_t old_handler = RT_NULL;
     int index;
 
-    if ((vector < 0) || (vector > INTERRUPTS_MAX))
+    if ((vector < 0) || (vector >= INTERRUPTS_MAX))
     {
         return old_handler;
     }