Skip to content

Commit

Permalink
leds: Fix bounds checking of wm8350->pmic.led
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Liam Girdwood committed Jan 30, 2009
1 parent 9bf503e commit 8dd2c9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/wm8350-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8dd2c9e

Please sign in to comment.