Skip to contentSkip to conversation

s3c: fix check of index into s3c_gpios[]

PATCH New akpm at linux-foundation.org 1 participant 1 message Sep 18, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 s3c: fix check of index into s3c_gpios[]

From: Roel Kluin <[email protected]>

The check of the s3c_gpios[] index had an off-by-one.

---

 arch/arm/plat-s3c/gpio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-s3c/gpio.c renamed from arch/arm/plat-s3c/gpio.c~s3c-fix-check-of-index-into-s3c_gpios +1 -1
diff -puN arch/arm/plat-s3c/gpio.c~s3c-fix-check-of-index-into-s3c_gpios arch/arm/plat-s3c/gpio.c
@@ -28,7 +28,7 @@ static __init void s3c_gpiolib_track(str
 
 	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;
 	}
 }

_