提交 75e52ba1 编写于 作者: N Niklas Cassel 提交者: Jesper Nilsson

cris: irq: stop loop from accessing array out of bounds

array "interrupt" only has 32 or 64 elements, depending on machine.

arch/cris/arch-v32/kernel/irq.c: In function ‘init_IRQ’:
arch/cris/arch-v32/kernel/irq.c:475:3: warning: iteration 32u invokes undefined behavior [-Waggressive-loop-optimizations]
   set_exception_vector(i, interrupt[j]);
   ^
arch/cris/arch-v32/kernel/irq.c:474:2: note: containing loop
  for (i = FIRST_IRQ, j = 0; j < NBR_INTR_VECT; i++, j++) {
  ^
Signed-off-by: NNiklas Cassel <nks@flawful.org>
Signed-off-by: NJesper Nilsson <jespern@axis.com>
上级 d355bcb0
...@@ -471,9 +471,8 @@ init_IRQ(void) ...@@ -471,9 +471,8 @@ init_IRQ(void)
irq_set_default_host(domain); irq_set_default_host(domain);
of_node_put(np); of_node_put(np);
for (i = FIRST_IRQ, j = 0; j < NBR_INTR_VECT; i++, j++) { for (i = FIRST_IRQ, j = 0; j < NBR_INTR_VECT && j < MACH_IRQS; i++, j++)
set_exception_vector(i, interrupt[j]); set_exception_vector(i, interrupt[j]);
}
/* Mark Timer and IPI IRQs as CPU local */ /* Mark Timer and IPI IRQs as CPU local */
irq_allocations[TIMER0_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED; irq_allocations[TIMER0_INTR_VECT - FIRST_IRQ].cpu = CPU_FIXED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册