From: Roel Kluin Date: Fri, 18 Sep 2009 19:44:17 +0000 (-0700) Subject: ARM: s3c: fix check of index into s3c_gpios[] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7da18afa423f167e7ef3c9728e584d8bf05bd55a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ARM: s3c: fix check of index into s3c_gpios[] The check of the s3c_gpios[] index had an off-by-one. Signed-off-by: Roel Kluin Acked-by: Ben Dooks Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Russell King --- diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-s3c/gpio.c index 260fdc6ad68..5ff24e0f9f8 100644 --- a/arch/arm/plat-s3c/gpio.c +++ b/arch/arm/plat-s3c/gpio.c @@ -28,7 +28,7 @@ static __init void s3c_gpiolib_track(struct s3c_gpio_chip *chip) gpn = chip->chip.base; for (i = 0; i < chip->chip.ngpio; i++, gpn++) { - BUG_ON(gpn > ARRAY_SIZE(s3c_gpios)); + BUG_ON(gpn >= ARRAY_SIZE(s3c_gpios)); s3c_gpios[gpn] = chip; } }