* [PATCH] S3C: beyond ARRAY_SIZE of s3c_gpios
@ 2009-05-20 15:51 Roel Kluin
2009-05-27 5:57 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-05-20 15:51 UTC (permalink / raw)
To: ben-linux; +Cc: lkml, Andrew Morton
Do not go beyond ARRAY_SIZE of s3c_gpios
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-s3c/gpio.c
index d71dd6d..29926c1 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;
}
}
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] S3C: beyond ARRAY_SIZE of s3c_gpios
2009-05-20 15:51 [PATCH] S3C: beyond ARRAY_SIZE of s3c_gpios Roel Kluin
@ 2009-05-27 5:57 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2009-05-27 5:57 UTC (permalink / raw)
To: Roel Kluin; +Cc: ben-linux, lkml
On Wed, 20 May 2009 17:51:07 +0200 Roel Kluin <roel.kluin@gmail.com> wrote:
> Do not go beyond ARRAY_SIZE of s3c_gpios
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/arch/arm/plat-s3c/gpio.c b/arch/arm/plat-s3c/gpio.c
> index d71dd6d..29926c1 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;
> }
> }
umm, OK, but the title and changelog are quite inaccurate.
I rewrote the title to
s3c: fix check of index into s3c_gpios[]
and rewrote the changelog to
The check of the s3c_gpios[] index had an off-by-one.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-05-27 5:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 15:51 [PATCH] S3C: beyond ARRAY_SIZE of s3c_gpios Roel Kluin
2009-05-27 5:57 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox