mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
leds: mt6323: Fix an off by one bug in probe
It should be ">= MT6323_MAX_LEDS" instead of ">". Also "reg" is a u32
so it can't be negative and we can remove the test for negative values.
Fixes: 216ec6cc4c ("leds: Add LED support for MT6323 PMIC")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Signed-off-by: Jacek Anaszewski <[email protected]>
This commit is contained in:
parent
6234004ce4
commit
ac57245215
1 changed files with 1 additions and 1 deletions
|
|
@ -417,7 +417,7 @@ static int mt6323_led_probe(struct platform_device *pdev)
|
|||
goto put_child_node;
|
||||
}
|
||||
|
||||
if (reg < 0 || reg > MT6323_MAX_LEDS || leds->led[reg]) {
|
||||
if (reg >= MT6323_MAX_LEDS || leds->led[reg]) {
|
||||
dev_err(dev, "Invalid led reg %u\n", reg);
|
||||
ret = -EINVAL;
|
||||
goto put_child_node;
|
||||
|
|
|
|||
Loading…
Reference in a new issue