linux-stable/drivers/iio/buffer
Matti Vaittinen 0a33755c4b iio: Don't silently expect attribute types
The iio_triggered_buffer_setup_ext() and the
devm_iio_kfifo_buffer_setup_ext() were changed by
commit 15097c7a1a ("iio: buffer: wrap all buffer attributes into iio_dev_attr")
to silently expect that all attributes given in buffer_attrs array are
device-attributes. This expectation was not forced by the API - and some
drivers did register attributes created by IIO_CONST_ATTR().

When using IIO_CONST_ATTRs the added attribute "wrapping" does not copy
the pointer to stored string constant and when the sysfs file is read the
kernel will access to invalid location.

Change the function signatures to expect an array of iio_dev_attrs to
avoid similar errors in the future.

Merge conflict resolved whilst applying due to patch crossing with
two new drivers (kx022a accelerometer and ad4130 ADC).

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/63f54787a684eb1232f1c5d275a09c786987fe4a.1664782676.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:44:04 +00:00
..
Kconfig iio: buffer: Kconfig: add title for IIO_TRIGGERED_BUFFER symbol 2020-09-29 17:27:08 +01:00
Makefile
industrialio-buffer-cb.c iio: buffer: Return error if no callback is given 2020-12-03 19:32:40 +00:00
industrialio-buffer-dma.c iio: dma-buffer: Cleanup buffer.h/buffer_impl.h includes 2020-04-19 16:56:31 +01:00
industrialio-buffer-dmaengine.c iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
industrialio-hw-consumer.c iio: hw_consumer: Use struct_size() helper in kzalloc() 2022-01-23 18:03:37 +00:00
industrialio-triggered-buffer.c iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00
kfifo_buf.c iio: Don't silently expect attribute types 2022-11-23 19:44:04 +00:00