linux/drivers/iio
Zicheng Qu efa353ae1b iio: adc: ad7124: fix division by zero in ad7124_set_channel_odr()
In the ad7124_write_raw() function, parameter val can potentially
be zero. This may lead to a division by zero when DIV_ROUND_CLOSEST()
is called within ad7124_set_channel_odr(). The ad7124_write_raw()
function is invoked through the sequence: iio_write_channel_raw() ->
iio_write_channel_attribute() -> iio_channel_write(), with no checks
in place to ensure val is non-zero.

Cc: stable@vger.kernel.org
Fixes: 7b8d045e49 ("iio: adc: ad7124: allow more than 8 channels")
Signed-off-by: Zicheng Qu <quzicheng@huawei.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20241022134330.574601-1-quzicheng@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-10-24 18:30:47 +01:00
..
accel IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
adc iio: adc: ad7124: fix division by zero in ad7124_set_channel_odr() 2024-10-24 18:30:47 +01:00
addac move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
afe iio: afe: rescale: Accept only offset channels 2023-10-17 20:25:32 +01:00
amplifiers IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
buffer Merge 6.11-rc7 into char-misc-next 2024-09-09 08:36:23 +02:00
cdc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
chemical IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
common IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
dac IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
dummy iio: dummy: iio_simple_dummy_buffer: use iio_for_each_active_channel() 2024-08-03 10:13:39 +01:00
filter drivers: iio: filter: admv8818: add bypass mode 2023-08-08 09:51:06 +01:00
frequency IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
gyro move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
health move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
humidity move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
imu IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
light iio: light: veml6030: fix microlux value calculation 2024-10-24 18:30:03 +01:00
magnetometer IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
multiplexer iio: multiplexer: Remove an unused field in struct mux 2024-05-27 09:48:56 +01:00
orientation iio: orientation: hid-sensor-rotation: Convert to platform remove callback returning void 2023-09-23 15:06:56 +01:00
position iio: position: hid-sensor-custom-intel-hinge: Convert to platform remove callback returning void 2023-09-23 15:06:56 +01:00
potentiometer iio: potentiometer: max5487: Drop ACPI_PTR() usage 2024-01-23 22:06:55 +00:00
potentiostat iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-05-27 09:48:57 +01:00
pressure IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
proximity IIO: 1st set of fixes for the 6.12 cycle. 2024-10-13 17:23:47 +02:00
resolver iio: resolver: ad2s1210: add missing select (TRIGGERED_)BUFFER in Kconfig 2024-10-06 16:30:38 +01:00
temperature move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
test iio: test: gts: test available times and gains sorting 2024-05-27 09:48:56 +01:00
trigger iio: trigger: stm32-timer-trigger: make use of regmap_clear_bits(), regmap_set_bits() 2024-06-25 21:04:48 +01:00
iio_core_trigger.h
iio_core.h iio: Add iio_read_channel_label to inkern API 2024-06-28 20:06:56 +01:00
industrialio-acpi.c iio: core: Add iio_read_acpi_mount_matrix() helper function 2024-04-29 20:53:25 +01:00
industrialio-backend.c drivers:iio:Fix the NULL vs IS_ERR() bug for debugfs_create_dir() 2024-08-21 21:32:52 +01:00
industrialio-buffer.c iio: core: annotate masklength as __private 2024-08-03 10:13:43 +01:00
industrialio-configfs.c
industrialio-core.c iio: Fix spelling mistake "avaialable" -> "available" 2024-08-10 11:23:39 +01:00
industrialio-event.c iio: event: use sizeof(*pointer) instead of sizeof(type) 2024-06-13 19:19:23 +01:00
industrialio-gts-helper.c iio: gts-helper: Fix memory leaks for the error path of iio_gts_build_avail_scale_table() 2024-10-19 15:10:33 +01:00
industrialio-sw-device.c iio: Don't use bare "unsigned" 2022-07-01 11:19:08 +01:00
industrialio-sw-trigger.c iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails 2022-11-12 17:53:35 +00:00
industrialio-trigger.c iio: trigger: allow devices to suspend/resume theirs associated trigger 2024-08-10 11:19:36 +01:00
industrialio-triggered-event.c
inkern.c iio: fix scale application in iio_convert_raw_to_processed_unlocked 2024-08-03 16:29:32 +01:00
Kconfig iio: core: Add new DMABUF interface infrastructure 2024-06-30 11:29:17 +01:00
Makefile iio: core: Add iio_read_acpi_mount_matrix() helper function 2024-04-29 20:53:25 +01:00
TODO iio: core: move 'mlock' to 'struct iio_dev_opaque' 2022-11-23 19:44:00 +00:00