linux-uconsole/include/linux/iio
Martin Kelly 5c39f9f374 iio:buffer: make length types match kfifo types
commit c043ec1ca5 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: accel: kxcjk1013 3-axis accelerometer driver 2014-06-14 17:10:21 +01:00
adc iio: ad_sigma_delta: Implement a dedicated reset function 2017-10-12 11:27:34 +02:00
common iio: st_sensors: add debugfs register read hook 2015-08-16 10:51:25 +01:00
dac iio: max517: Add support for MAX520 and MAX521 chips. 2015-03-28 10:57:34 +00:00
frequency
gyro
imu iio: adis: Switch sampling frequency attr to core support. 2014-07-07 09:44:17 +01:00
buffer.h iio:buffer: make length types match kfifo types 2018-07-03 11:21:30 +02:00
consumer.h include: linux: iio: Fix function parameter name in kernel doc 2015-08-02 18:34:18 +01:00
driver.h
events.h iio: Export userspace IIO headers 2015-02-14 17:05:03 +00:00
iio.h iio: Support triggered events 2015-08-27 20:47:09 +01:00
kfifo_buf.h iio: kfifo: Add resource management devm_iio_kfifo_allocate/free 2014-12-26 11:39:57 +00:00
machine.h
sysfs.h include: linux: iio: Add missing kernel doc field 2015-08-02 18:36:05 +01:00
trigger.h iio: declare struct to fix warning 2015-08-08 12:28:46 +01:00
trigger_consumer.h
triggered_buffer.h iio: Fix parameters in iio_triggered_buffer_setup 2015-07-05 15:19:50 +01:00
triggered_event.h iio: Support triggered events 2015-08-27 20:47:09 +01:00
types.h iio: core: add high pass filter attributes 2015-05-17 10:32:35 +01:00