diff mbox series

[PATCHv3,4/5] um: Fix off by one error in IRQ enumeration

Message ID 20190722073025.20844-4-anton.ivanov@cambridgegreys.com
State Not Applicable
Headers show
Series None | expand

Commit Message

Anton Ivanov July 22, 2019, 7:30 a.m. UTC
From: Anton Ivanov <anton.ivanov@cambridgegreys.com>

Fix an off-by-one in IRQ enumeration

Reported by: Dana Johnson <djohns042@gmail.com>
Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com>
---
 arch/um/include/asm/irq.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Johannes Berg July 30, 2019, 6:56 a.m. UTC | #1
On Mon, 2019-07-22 at 08:30 +0100, anton.ivanov@cambridgegreys.com
wrote:
> From: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> 
> Fix an off-by-one in IRQ enumeration
> 
> Reported by: Dana Johnson <djohns042@gmail.com>

nit: "Reported-by"
 
> -#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ)
> +#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ - 1)

Somebody internally at my group just made the same patch, but came to
the cnoclusion that we also need, in arch/um/kernel/irq.c:


-   for (i = 1; i < LAST_IRQ; i++)
+   for (i = 1; i <= LAST_IRQ; i++)

in init_IRQ()?

johannes
diff mbox series

Patch

diff --git a/arch/um/include/asm/irq.h b/arch/um/include/asm/irq.h
index 49ed3e35b35a..ce7a78c3bcf2 100644
--- a/arch/um/include/asm/irq.h
+++ b/arch/um/include/asm/irq.h
@@ -23,7 +23,7 @@ 
 #define VECTOR_BASE_IRQ		15
 #define VECTOR_IRQ_SPACE	8
 
-#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ)
+#define LAST_IRQ (VECTOR_IRQ_SPACE + VECTOR_BASE_IRQ - 1)
 
 #else