iio: hid-sensors: typo leads to potential forever loop
Subsystems (2)
PATCH 1/1 iio: hid-sensors: typo leads to potential forever loop
The "i < " was missing in this condition.
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1 -1
@@ -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(
OOPs. Good catch.
Thanks,
Srinivas
Quoted 23 lines · Dan Carpenter
The "i < " was missing in this condition.
Fixes 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')Signed-off-by Dan Carpenter <[email protected]>drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1
-2@@ -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( --To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Srinivas Pandruvada
OOPs. Good catch.
Thanks,
SrinivasQuoted 4 lines · Dan Carpenter
The "i < " was missing in this condition.
Fixes 5d02edfc3957 ('iio: hid-sensors: Convert units and exponent')Signed-off-by Dan Carpenter <[email protected]>
Applied to the togreg branch of iio.igt
Thanks,
Quoted 23 lines
Quoted 14 lines
drivers/iio/common/hid-sensors/hid-sensor-attributes.c +1
-2@@ -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( --Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html