gpio: ep93xx: fix incorrect array element size check
authorColin Ian King <colin.king@canonical.com>
Thu, 6 Sep 2018 11:58:30 +0000 (12:58 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 10 Sep 2018 06:48:24 +0000 (08:48 +0200)
commitf40f73075c59b0d847eadbada9ec5c0d0142b107
treee6c5e27b1f1c055be8d9aeaa58f990bb4c5c5bd6
parent02ad0437decf2e5dba975c23b1a89775f4b211e1
gpio: ep93xx: fix incorrect array element size check

Currently the while loop checks for the end of the array using
the size of egp->gc rather that the number of elements in the array,
so fix this. Also, perform the array size check first as stylistically
it is always good to bounds check on an array first before referencing
the array (in this case, we're just computing the address of an
element in an array so this is a moot point).

Fixes: fd935fc421e7 ("gpio: ep93xx: Do not pingpong irq numbers")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-ep93xx.c