diff options
author | Sebastien Ronsse <sronsse@gmail.com> | 2015-01-12 17:17:25 +0000 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-01-23 17:24:54 -0700 |
commit | 07570e709765e93f2b1e9506cfd8fa24455636b5 (patch) | |
tree | 1d780546b2cb72b18935c838de9c953e29b0db2e | |
parent | 4df2b48fbee148cd2c4137ee920220338f0dcaf0 (diff) | |
download | u-boot-imx-07570e709765e93f2b1e9506cfd8fa24455636b5.zip u-boot-imx-07570e709765e93f2b1e9506cfd8fa24455636b5.tar.gz u-boot-imx-07570e709765e93f2b1e9506cfd8fa24455636b5.tar.bz2 |
x86: Fix out of bounds irq handlers access
Using coreboot-x86_defconfig, the following error occurred prior to this modification:
CC arch/x86/lib/interrupts
arch/x86/lib/interrupts.c: In function ‘do_irqinfo’:
arch/x86/lib/interrupts.c:134:24: error: iteration 16u invokes undefined behavior [-Werror=aggressive-loop-optimizations]
if (irq_handlers[irq].handler != NULL) {
^
arch/x86/lib/interrupts.c:133:2: note: containing loop
for (irq = 0; irq <= CONFIG_SYS_NUM_IRQS; irq++) {
^
cc1: all warnings being treated as errors
scripts/Makefile.build:275: recipe for target 'arch/x86/lib/interrupts.o' failed
make[1]: *** [arch/x86/lib/interrupts.o] Error 1
Makefile:1093: recipe for target 'arch/x86/lib' failed
make: *** [arch/x86/lib] Error 2
Change-Id: I3572a822081b72ab760f1eb99442e1161d3d167e
Signed-off-by: Sebastien Ronsse <sronsse@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/x86/lib/interrupts.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/lib/interrupts.c b/arch/x86/lib/interrupts.c index 6bb22d2..146ad11 100644 --- a/arch/x86/lib/interrupts.c +++ b/arch/x86/lib/interrupts.c @@ -130,7 +130,7 @@ int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) printf("Interrupt-Information:\n"); printf("Nr Routine Arg Count\n"); - for (irq = 0; irq <= CONFIG_SYS_NUM_IRQS; irq++) { + for (irq = 0; irq < CONFIG_SYS_NUM_IRQS; irq++) { if (irq_handlers[irq].handler != NULL) { printf("%02d %08lx %08lx %d\n", irq, |