iio: addac: stx104: Fix race condition for stx104_write_raw()
stable inclusion from stable-v5.10.192 commit aeecd8d97da758b9cc41cacfd45de0e76237b674 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=aeecd8d97da758b9cc41cacfd45de0e76237b674 -------------------------------- [ Upstream commit 97408274 ] 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: 97a445da ("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> Stable-dep-of: 4f9b80ae ("iio: addac: stx104: Fix race condition when converting analog-to-digital") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment