android_kernel_samsung_univ.../drivers/iio
Martin Kelly 5c39f9f374 iio:buffer: make length types match kfifo types
commit c043ec1ca5baae63726aae32abbe003192bc6eec upstream.

Currently, we use int for buffer length and bytes_per_datum. However,
kfifo uses unsigned int for length and size_t for element size. We need
to make sure these matches or we will have bugs related to overflow (in
the range between INT_MAX and UINT_MAX for length, for example).

In addition, set_bytes_per_datum uses size_t while bytes_per_datum is an
int, which would cause bugs for large values of bytes_per_datum.

Change buffer length to use unsigned int and bytes_per_datum to use
size_t.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[bwh: Backported to 4.4:
 - Drop change to iio_dma_buffer_set_length()
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03 11:21:30 +02:00
..
accel iio: st_pressure: st_accel: pass correct platform data to init 2018-03-28 18:40:12 +02:00
adc iio: hi8435: cleanup reset gpio 2018-04-13 19:50:08 +02:00
amplifiers
buffer iio:buffer: make length types match kfifo types 2018-07-03 11:21:30 +02:00
chemical
common iio: hid-sensor-trigger: Fix the race with user space powering up sensors 2017-08-30 10:19:27 +02:00
dac
frequency
gyro
humidity
imu iio: adis_lib: Initialize trigger before requesting interrupt 2018-02-28 10:17:22 +01:00
light iio: light: fix improper return value 2017-11-30 08:37:27 +00:00
magnetometer iio: magnetometer: st_magn_spi: fix spi_device_id table 2018-04-13 19:50:21 +02:00
orientation
potentiometer
pressure iio: st_pressure: st_accel: pass correct platform data to init 2018-03-28 18:40:12 +02:00
proximity
temperature
trigger iio: trigger: free trigger resource correctly 2017-11-15 17:13:10 +01:00
iio_core_trigger.h
iio_core.h
industrialio-buffer.c iio: buffer: check if a buffer has been set up when poll is called 2018-02-28 10:17:22 +01:00
industrialio-core.c iio: core: Return error for failed read_reg 2017-10-12 11:27:34 +02:00
industrialio-event.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c
Kconfig
Makefile