leds: Fix bounds checking of wm8350->pmic.led
PATCH 1/1 leds: Fix bounds checking of wm8350->pmic.led
Fix bounds checking of wm8350->pmic.led
Signed-off-by Roel Kluin <[email protected]>
---
drivers/regulator/wm8350-regulator.c +1 -1
@@ -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 ; }
Quoted 3 lines · Roel Kluin
Fix bounds checking of
wm8350->pmic.ledSigned-off-by Roel Kluin <[email protected]>
Acked-by Mark Brown <[email protected]>
but it probably ought to get pushed out via MFD - I'll send it along to Samuel.
Quoted 2 lines · Mark Brown
but it probably ought to get pushed out via MFD - I'll send it along to Samuel.
Eh, sorry - I meant regulator and Liam
Liam Girdwood
AppliedQuoted 9 lines · Roel Kluin
Fix bounds checking of
wm8350->pmic.ledSigned-off-by Roel Kluin <[email protected]>---
drivers/regulator/wm8350-regulator.c +0
-0
drivers/regulator/wm8350-regulator.c int wm8350_register_led(struct wm8350 *wm8350, int lednum, int dcdc, int isink,
Quoted 9 lines
drivers/regulator/wm8350-regulator.c +1
-2@@ -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