Commit bf7f5204 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

iio: hid-sensors: typo leads to potential forever loop

The "i < " was missing in this condition.

Fixes: 5d02edfc ('iio: hid-sensors: Convert units and exponent')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent c4784756
......@@ -327,7 +327,7 @@ int hid_sensor_format_scale(u32 usage_id,
*val0 = 1;
*val1 = 0;
for (i = 0; ARRAY_SIZE(unit_conversion); ++i) {
for (i = 0; i < ARRAY_SIZE(unit_conversion); ++i) {
if (unit_conversion[i].usage_id == usage_id &&
unit_conversion[i].unit == attr_info->units) {
exp = hid_sensor_convert_exponent(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment