charger: axp2101: Guards against out-of-bounds read
Corrects the out-of-bounds check when reading constant_charge_voltage_lut Signed-off-by: Ricardo Rivera-Matos <ricardo.rivera-matos@cirrus.com>
This commit is contained in:
parent
18aa6c8901
commit
2bb7fcc5df
1 changed files with 1 additions and 1 deletions
|
@ -220,7 +220,7 @@ static int get_constant_charge_voltage_uv(const struct device *dev, union charge
|
|||
return ret;
|
||||
}
|
||||
|
||||
if (tmp > ARRAY_SIZE(constant_charge_voltage_lut)) {
|
||||
if (tmp >= ARRAY_SIZE(constant_charge_voltage_lut)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue