diff options
| author | Josef Bacik <josef@toxicpanda.com> | 2026-10-27 17:19:15 +0100 |
|---|---|---|
| committer | Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> | 2026-11-11 02:53:02 +0000 |
| commit | fd4c92bbd3a64556e81042ff8d30545b15a3b93a (patch) | |
| tree | 44bca988f9945162c16754cfd4a3cb97807de579 /kernel/debug/debug_core.c | |
| parent | bbe4f3f668babc9443fc1f075695e43e17ca7976 (diff) | |
iio: hid-sensors: fix a division by zero
convert_to_vtf_format() divides the micro part of a value by
10^(6 + exp). The unit exponent of a HID field is a nibble and goes
down to -8. For -7 and -8 the argument of int_pow() is negative, which
the unsigned parameter turns into a huge power of ten: 0 modulo 2^64.
The division by it is a divide error. The exponent comes from the report
descriptor of the sensor hub, the value from a write to the hysteresis
attribute of the IIO device.
Multiply by 10^(-exp - 6) in these two cases.
Fixes: 73c6768b710a ("iio: hid-sensors: Common attribute and trigger")
Cc: stable <stable@kernel.org>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'kernel/debug/debug_core.c')
0 files changed, 0 insertions, 0 deletions
