linux/drivers/iio
Arnd Bergmann d70674eeaa iio: maxim_thermocouple: detect invalid storage size in read()
As found by gcc -Wmaybe-uninitialized, having a storage_bytes value other
than 2 or 4 will result in undefined behavior:

drivers/iio/temperature/maxim_thermocouple.c: In function 'maxim_thermocouple_read':
drivers/iio/temperature/maxim_thermocouple.c:141:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This probably cannot happen, but returning -EINVAL here is appropriate
and makes gcc happy and the code more robust.

Fixes: 231147ee77 ("iio: maxim_thermocouple: Align 16 bit big endian value of raw reads")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit 32cb7d27e6)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-13 10:08:32 +01:00
..
accel iio: st_sensors: fix scale configuration for h3lis331dl 2016-10-30 16:46:46 +00:00
adc iio: adc: ti-adc081c: Select IIO_TRIGGERED_BUFFER to prevent build errors 2016-10-09 08:45:07 +01:00
amplifiers
buffer
chemical iio:chemical:atlas-ph-sensor: Fix use of 32 bit int to hold 16 bit big endian value 2016-10-23 22:18:27 +01:00
common iio: hid-sensors: Increase the precision of scale to fix wrong reading interpretation. 2016-11-05 17:50:56 +00:00
dac
dummy
frequency
gyro
health
humidity
imu
light
magnetometer
orientation iio: orientation: hid-sensor-rotation: Add PM function (fix non working driver) 2016-11-05 17:47:47 +00:00
potentiometer
pressure
proximity
temperature iio: maxim_thermocouple: detect invalid storage size in read() 2016-11-13 10:08:32 +01:00
trigger
Kconfig
Makefile
iio_core.h
iio_core_trigger.h
industrialio-buffer.c
industrialio-configfs.c
industrialio-core.c
industrialio-event.c
industrialio-sw-device.c
industrialio-sw-trigger.c
industrialio-trigger.c
industrialio-triggered-event.c
inkern.c