Skip to content

Commit

Permalink
irqchip: crossbar: Off by one bugs in init
Browse files Browse the repository at this point in the history
My static checker complains that the ">" should be ">=" or else we go
beyond the end of the cb->irq_map[] array on the next line.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
Dan Carpenter authored and Jason Cooper committed Aug 18, 2014
1 parent c44e9d7 commit 702f7e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/irqchip/irq-crossbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 702f7e3

Please sign in to comment.