From bf7f5204abdba94032ff7cae1c9c8c9e7671d246 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 5 Sep 2014 12:56:00 +0100 Subject: iio: hid-sensors: typo leads to potential forever loop The "i < " was missing in this condition. Fixes: 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent') Signed-off-by: Dan Carpenter Signed-off-by: Jonathan Cameron --- drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/iio/common') diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c index 372964635ccf..3052eb150099 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c @@ -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( -- cgit v1.2.1