leds: Fix bounds checking of wm8350->pmic.led
authorRoel Kluin <roel.kluin@gmail.com>
Sat, 17 Jan 2009 15:06:40 +0000 (16:06 +0100)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 30 Jan 2009 21:50:49 +0000 (21:50 +0000)
Fix bounds checking of wm8350->pmic.led

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/wm8350-regulator.c

index 7aa35248181bd4b021e5d638343e1bfd57459030..5056e23e441471f658276c802300d5a8aba3355f 100644 (file)
@@ -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;
        }