Skip to contentSkip to conversation

irqchip: sunxi-nmi: Fix off-by-one for iterating over gc->num_ct

PATCH In review Axel Lin 4 participants 4 messages Jun 7, 2015 – Jun 8, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 irqchip: sunxi-nmi: Fix off-by-one for iterating over gc->num_ct

---
 drivers/irqchip/irq-sunxi-nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-sunxi-nmi.c +1 -1
index 12f547a..eb9b59e 100644
@@ -104,7 +104,7 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
 	irqd_set_trigger_type(data, flow_type);
 	irq_setup_alt_chip(data, flow_type);
 
-	for (i = 0; i <= gc->num_ct; i++, ct++)
+	for (i = 0; i < gc->num_ct; i++, ct++)
 		if (ct->type & flow_type)
 			ctrl_off = ct->regs.type;
 
Signature · 1 line
1.8.3.2
Acked-by on v1 1/1
#2 lore raw
In reply to Axel Lin
Quoted 10 lines · Axel Lin
---
 drivers/irqchip/irq-sunxi-nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-sunxi-nmi.c +0 -0
index 12f547a..eb9b59e 100644

drivers/irqchip/irq-sunxi-nmi.c static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type) · line 109

Quoted 7 lines
drivers/irqchip/irq-sunxi-nmi.c +1 -1
@@ -104,7 +104,7 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
        irqd_set_trigger_type(data, flow_type);
        irq_setup_alt_chip(data, flow_type);
 
-       for (i = 0; i <= gc->num_ct; i++, ct++)
+       for (i = 0; i < gc->num_ct; i++, ct++)
                if (ct->type & flow_type)
                        ctrl_off = ct->regs.type;
Signature · 1 line
Carlo Caione
#3 lore raw

[tip:irq/urgent] irqchip: sunxi-nmi: Fix off-by-one error in irq iterator

In reply to Axel Lin
irqchip: sunxi-nmi: Fix off-by-one error in irq iterator
Commit-ID:  febe06962ab191db50e633a0f79d9fb89a2d1078
Gitweb:     http://git.kernel.org/tip/febe06962ab191db50e633a0f79d9fb89a2d1078
Author:     Axel Lin <[email protected]>
AuthorDate: Sun, 7 Jun 2015 21:33:29 +0800
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 8 Jun 2015 10:08:50 +0200

irqchip: sunxi-nmi: Fix off-by-one error in irq iterator

Fixes 6058bb362818 'ARM: sun7i/sun6i: irqchip: Add irqchip driver for NMI controller'
Cc Maxime Ripard <[email protected]>
Cc Carlo Caione <[email protected]>
Cc Jason Cooper <[email protected]>
---
 drivers/irqchip/irq-sunxi-nmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-sunxi-nmi.c +1 -1
index 4a9ce5b..6b2b582 100644
@@ -104,7 +104,7 @@ static int sunxi_sc_nmi_set_type(struct irq_data *data, unsigned int flow_type)
 	irqd_set_trigger_type(data, flow_type);
 	irq_setup_alt_chip(data, flow_type);
 
-	for (i = 0; i <= gc->num_ct; i++, ct++)
+	for (i = 0; i < gc->num_ct; i++, ct++)
 		if (ct->type & flow_type)
 			ctrl_off = ct->regs.type;