linux-stable/drivers/iio/addac
William Breathitt Gray d2ed95545d 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:10:51 +09:00
..
Kconfig iio: addac: add AD74115 driver 2022-11-23 20:49:00 +00:00
Makefile iio: addac: add AD74115 driver 2022-11-23 20:49:00 +00:00
ad74115.c iio: addac: ad74115: remove unused ad74115_dac_slew_rate_hz_tbl 2022-11-24 19:23:57 +00:00
ad74413r.c iio: addac: ad74413r: fix blank line after declaration warning 2022-11-24 19:24:34 +00:00
stx104.c iio: addac: stx104: Fix race condition for stx104_write_raw() 2023-05-11 23:10:51 +09:00