linux/drivers/iio/addac
William Breathitt Gray 9fd4768b09 iio: addac: stx104: Fix race condition for stx104_write_raw()
commit 9740827468 upstream.

The priv->chan_out_states array and actual DAC value can become
mismatched if stx104_write_raw() is called concurrently. Prevent such a
race condition by utilizing a mutex.

Fixes: 97a445dad3 ("iio: Add IIO support for the DAC on the Apex Embedded Systems STX104")
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/c95c9a77fcef36b2a052282146950f23bbc1ebdc.1680790580.git.william.gray@linaro.org
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-11 23:03:01 +09:00
..
ad74413r.c iio: addac: ad74413r: fix integer promotion bug in ad74413_get_input_current_offset() 2022-12-31 13:33:10 +01:00
Kconfig iio: stx104: Move to addac subdirectory 2022-08-20 13:09:38 +01:00
Makefile iio: stx104: Move to addac subdirectory 2022-08-20 13:09:38 +01:00
stx104.c iio: addac: stx104: Fix race condition for stx104_write_raw() 2023-05-11 23:03:01 +09:00