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

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