Commit f6d9af47 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Walleij

gpio: ep93xx: fix test for end of loop

The problem is that if port == ARRAY_SIZE() and "gc == &epg->gc[port]"
then that should be treated as invalid.

Fixes: fd935fc4 ("gpio: ep93xx: Do not pingpong irq numbers")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent f40f7307
......@@ -80,7 +80,7 @@ static int ep93xx_gpio_port(struct gpio_chip *gc)
port++;
/* This should not happen but is there as a last safeguard */
if (gc != &epg->gc[port]) {
if (port == ARRAY_SIZE(epg->gc)) {
pr_crit("can't find the GPIO port\n");
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment