diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/ti-abb-regulator.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c index c1870ea64939..870d209ec866 100644 --- a/drivers/regulator/ti-abb-regulator.c +++ b/drivers/regulator/ti-abb-regulator.c @@ -387,8 +387,8 @@ static int ti_abb_get_voltage_sel(struct regulator_dev *rdev) return -EINVAL; } - if (abb->current_info_idx > (int)desc->n_voltages) { - dev_err(dev, "%s: Corrupted data? idx(%d) > n_voltages(%d)\n", + if (abb->current_info_idx >= (int)desc->n_voltages) { + dev_err(dev, "%s: Corrupted data? idx(%d) >= n_voltages(%d)\n", __func__, abb->current_info_idx, desc->n_voltages); return -EINVAL; } |