public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds: Fix bounds checking of wm8350->pmic.led
@ 2009-01-17 15:06 Roel Kluin
  2009-01-17 16:05 ` Mark Brown
  2009-01-17 16:20 ` Liam Girdwood
  0 siblings, 2 replies; 4+ messages in thread
From: Roel Kluin @ 2009-01-17 15:06 UTC (permalink / raw)
  To: rpurdie, broonie; +Cc: lkml

Fix bounds checking of wm8350->pmic.led

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 7aa3524..5056e23 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -1435,7 +1435,7 @@ int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink,
 	struct platform_device *pdev;
 	int ret;
 
-	if (lednum > ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
+	if (lednum >= ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
 		dev_err(wm8350->dev, "Invalid LED index %d\n", lednum);
 		return -ENODEV;
 	}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Fix bounds checking of wm8350->pmic.led
  2009-01-17 15:06 [PATCH] leds: Fix bounds checking of wm8350->pmic.led Roel Kluin
@ 2009-01-17 16:05 ` Mark Brown
  2009-01-17 16:08   ` Mark Brown
  2009-01-17 16:20 ` Liam Girdwood
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2009-01-17 16:05 UTC (permalink / raw)
  To: Roel Kluin; +Cc: rpurdie, lkml

On Sat, Jan 17, 2009 at 04:06:40PM +0100, Roel Kluin wrote:
> Fix bounds checking of wm8350->pmic.led

> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

but it probably ought to get pushed out via MFD - I'll send it along to
Samuel.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Fix bounds checking of wm8350->pmic.led
  2009-01-17 16:05 ` Mark Brown
@ 2009-01-17 16:08   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2009-01-17 16:08 UTC (permalink / raw)
  To: Roel Kluin; +Cc: rpurdie, lkml

On Sat, Jan 17, 2009 at 04:05:32PM +0000, Mark Brown wrote:

> but it probably ought to get pushed out via MFD - I'll send it along to
> Samuel.

Eh, sorry - I meant regulator and Liam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] leds: Fix bounds checking of wm8350->pmic.led
  2009-01-17 15:06 [PATCH] leds: Fix bounds checking of wm8350->pmic.led Roel Kluin
  2009-01-17 16:05 ` Mark Brown
@ 2009-01-17 16:20 ` Liam Girdwood
  1 sibling, 0 replies; 4+ messages in thread
From: Liam Girdwood @ 2009-01-17 16:20 UTC (permalink / raw)
  To: Roel Kluin; +Cc: rpurdie, broonie, lkml

On Sat, 2009-01-17 at 16:06 +0100, Roel Kluin wrote:
> Fix bounds checking of wm8350->pmic.led
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
> index 7aa3524..5056e23 100644
> --- a/drivers/regulator/wm8350-regulator.c
> +++ b/drivers/regulator/wm8350-regulator.c
> @@ -1435,7 +1435,7 @@ int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink,
>  	struct platform_device *pdev;
>  	int ret;
>  
> -	if (lednum > ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
> +	if (lednum >= ARRAY_SIZE(wm8350->pmic.led) || lednum < 0) {
>  		dev_err(wm8350->dev, "Invalid LED index %d\n", lednum);
>  		return -ENODEV;
>  	}
> --

Applied.

Thanks

Liam


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-17 16:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17 15:06 [PATCH] leds: Fix bounds checking of wm8350->pmic.led Roel Kluin
2009-01-17 16:05 ` Mark Brown
2009-01-17 16:08   ` Mark Brown
2009-01-17 16:20 ` Liam Girdwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox