mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
leds: Fix bounds checking of wm8350->pmic.led
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>
This commit is contained in:
parent
9bf503e6be
commit
8dd2c9e312
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user