From: Roel Kluin Date: Sat, 17 Jan 2009 15:06:40 +0000 (+0100) Subject: leds: Fix bounds checking of wm8350->pmic.led X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8dd2c9e3128a5784a01084b52d5bb7efd4371ac6;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git leds: Fix bounds checking of wm8350->pmic.led Fix bounds checking of wm8350->pmic.led Signed-off-by: Roel Kluin Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 7aa35248181b..5056e23e4414 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; }