linux/drivers/iio
Akinobu Mita 7d6cd21d82 iio: adc: ina2xx: avoid kthread_stop() with stale task_struct
When the buffer is enabled for ina2xx driver, a dedicated kthread is
invoked to capture mesurement data.  When the buffer is disabled, the
kthread is stopped.

However if the kthread gets register access errors, it immediately exits
and when the malfunctional buffer is disabled, the stale task_struct
pointer is accessed as there is no kthread to be stopped.

A similar issue in the usbip driver is prevented by kthread_get_run and
kthread_stop_put helpers by increasing usage count of the task_struct.
This change applies the same solution.

Cc: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Fixes: c43a102e67 ("iio: ina2xx: add support for TI INA2xx Power Monitors")
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-07-07 17:06:39 +01:00
..
accel iio: accel: adxl345: add calibration offset support 2018-06-30 18:27:27 +01:00
adc iio: adc: ina2xx: avoid kthread_stop() with stale task_struct 2018-07-07 17:06:39 +01:00
afe iio: afe: rescale: new driver 2018-04-28 18:03:22 +01:00
amplifiers iio: amplifiers: ad8366: move channel init before iio_device_register() 2018-05-22 18:13:45 +01:00
buffer iio:kfifo_buf: check for uint overflow 2018-03-30 11:16:12 +01:00
chemical 1st round of IIO new device support, features and cleanup for the 4.18 cycle 2018-05-11 09:50:04 +02:00
common Staging/IIO patches for 4.18-rc1 2018-06-09 10:32:39 -07:00
counter iio: 104-quad-8: Provide defines for magic numbers 2018-06-10 11:52:30 +01:00
dac First set of IIO new device support, features and cleanups in the 4.19 cycle 2018-06-26 07:47:37 +08:00
dummy iio:dummy: Add extra paragraphs on Kconfig 2018-03-03 15:20:16 +00:00
frequency iio:frequency: drop assign iio_info.driver_module 2017-08-22 21:28:20 +01:00
gyro iio: Replace occurrences of magic number 0 by IIO_CHAN_INFO_RAW 2018-03-07 20:14:36 +00:00
health iio: add SPDX identifier for various drivers 2018-02-18 11:55:19 +00:00
humidity iio: add SPDX identifier for various drivers 2018-02-18 11:55:19 +00:00
imu First set of IIO new device support, features and cleanups in the 4.19 cycle 2018-06-26 07:47:37 +08:00
light iio: tsl2583: correct values in integration_time_available 2018-05-20 10:29:28 +01:00
magnetometer iio: magnetometer: mag3110: Add ability to run in continuous mode 2018-05-12 11:01:59 +01:00
multiplexer treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
orientation iio:orientation: drop assign iio_info.driver_module 2017-08-22 21:33:36 +01:00
potentiometer iio: potentiometer: mcp4531: switch to using .probe_new 2018-04-15 18:12:51 +01:00
potentiostat iio: potentiostat: lmp91000: add LMP91002 support 2018-05-12 11:02:44 +01:00
pressure 1st round of IIO new device support, features and cleanup for the 4.18 cycle 2018-05-11 09:50:04 +02:00
proximity Second set of new device support, features and cleanup for IIO in the 4.17 cycle 2018-03-14 12:32:11 +01:00
resolver staging: iio: ad2s1200: Move driver out of staging 2018-05-20 12:17:48 +01:00
temperature iio temperature/mlx90632: silence a static checker warning 2018-02-24 13:32:05 +00:00
trigger iio: stm32: Adopt SPDX identifier 2018-01-08 16:03:41 +01:00
iio_core_trigger.h
iio_core.h the rest of drivers/*: annotate ->poll() instances 2017-11-28 11:06:58 -05:00
industrialio-buffer.c First round of IIO fixes for the 4.16 cycle. 2018-02-20 10:03:22 +01:00
industrialio-configfs.c iio: make function argument and some structures const 2017-10-19 16:15:24 +02:00
industrialio-core.c iio: use timespec64 based interfaces for iio_get_time_ns() 2018-06-24 14:45:06 +01:00
industrialio-event.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
industrialio-sw-device.c iio: make function argument and some structures const 2017-10-19 16:15:24 +02:00
industrialio-sw-trigger.c iio: make function argument and some structures const 2017-10-19 16:15:24 +02:00
industrialio-trigger.c iio:trigger: Remove necessity to have a trig->ops structure. 2017-08-22 21:20:28 +01:00
industrialio-triggered-event.c
inkern.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
Kconfig staging: iio: ad2s1200: Move driver out of staging 2018-05-20 12:17:48 +01:00
Makefile staging: iio: ad2s1200: Move driver out of staging 2018-05-20 12:17:48 +01:00