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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	}