summaryrefslogtreecommitdiffstats
path: root/scripts/include/xalloc.h
diff options
context:
space:
mode:
authorJinseob Kim <kimjinseob88@gmail.com>2026-09-21 15:24:21 +0900
committerJonathan Cameron <jonathan.cameron@oss.qualcomm.com>2026-09-30 18:59:56 +0100
commit84bb0fc46ccf6a545b8fdf57cda83770186ed8dd (patch)
tree0130584f221b17682ce155e21cb78dee9cf68f04 /scripts/include/xalloc.h
parent52da294027f53e7084c18dd4b4f73354a40382f3 (diff)
downloadlinux-stable-84bb0fc46ccf6a545b8fdf57cda83770186ed8dd.tar.gz
linux-stable-84bb0fc46ccf6a545b8fdf57cda83770186ed8dd.zip
iio: buffer: serialize buffer teardown with mode claims
Buffer-mode claims hold mlock to guarantee that the device remains in buffer mode until the claim is released. Normal buffer updates take info_exist_lock followed by mlock in iio_update_buffers(). However, iio_device_unregister() disables and deactivates all buffers without taking mlock. This can invalidate buffer state, including active_scan_mask, while a buffer-mode claim is held. Take mlock in iio_disable_all_buffers() so that unregister honors the mode-claim lifetime guarantee. The info_exist_lock -> mlock ordering matches iio_update_buffers(). Fixes: 0a8565425afd ("iio: core: introduce iio_device_{claim|release}_buffer_mode() APIs") Suggested-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Jinseob Kim <kimjinseob88@gmail.com> Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com> Reviewed-by: Nuno Sá <nuno.sa@analog.com> Cc: stable@vger.kernel.org Signed-off-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
Diffstat (limited to 'scripts/include/xalloc.h')
0 files changed, 0 insertions, 0 deletions