Skip to contentSkip to conversation

irqchip/irq-crossbar: off by one bugs in init

PATCH Applied Dan Carpenter 2 participants 2 messages Aug 7, 2014 – Aug 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip/irq-crossbar: off by one bugs in init

My static checker complains that the ">" should be ">=" or else we go beyoned the end of the cb->irq_map[] array on the next line.

drivers/irqchip/irq-crossbar.c +2 -2
index 85c2985..bbbaf5d 100644
@@ -220,7 +220,7 @@ static int __init crossbar_of_init(struct device_node *node)
 			of_property_read_u32_index(node,
 						   "ti,irqs-reserved",
 						   i, &entry);
-			if (entry > max) {
+			if (entry >= max) {
 				pr_err("Invalid reserved entry\n");
 				ret = -EINVAL;
 				goto err_irq_map;
@@ -238,7 +238,7 @@ static int __init crossbar_of_init(struct device_node *node)
 			of_property_read_u32_index(node,
 						   "ti,irqs-skip",
 						   i, &entry);
-			if (entry > max) {
+			if (entry >= max) {
 				pr_err("Invalid skip entry\n");
 				ret = -EINVAL;
 				goto err_irq_map;
Applied
#1 lore raw

Dan,

Quoted 4 lines · Dan Carpenter

My static checker complains that the ">" should be ">=" or else we go beyoned the end of the cb->irq_map[] array on the next line.

Applied to irqchip/urgent

thx,

Jason.