Skip to content

Commit

Permalink
ARM: s3c: fix check of index into s3c_gpios[]
Browse files Browse the repository at this point in the history
The check of the s3c_gpios[] index had an off-by-one.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Roel Kluin authored and Russell King committed Sep 19, 2009
1 parent 3318c4b commit 7da18af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/plat-s3c/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7da18af

Please sign in to comment.