提交 8dd2c9e3 编写于 作者: R Roel Kluin 提交者: Liam Girdwood

leds: Fix bounds checking of wm8350->pmic.led

Fix bounds checking of wm8350->pmic.led
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 9bf503e6
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册