]> git.hungrycats.org Git - linux/commit
ALSA: pcm: Fix unlocked runtime state reads in xfer ioctls
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Fri, 5 Jun 2026 15:48:27 +0000 (12:48 -0300)
committerTakashi Iwai <tiwai@suse.de>
Sat, 6 Jun 2026 16:18:04 +0000 (18:18 +0200)
commit98fe3988a2efe89a1a1ded213a0561e6543e94e2
tree7389a3517220e0830919057779340b8806b53d06
parent2b7bd6f548292aec92a386deebe62324d21d62a9
ALSA: pcm: Fix unlocked runtime state reads in xfer ioctls

The recent runtime state locking cleanup converted several PCM ioctl state
checks to snd_pcm_get_state(), including snd_pcm_pre_prepare(),
snd_pcm_drain() and snd_pcm_kernel_ioctl(). The native and compat xfer
ioctl paths still sample runtime->state directly before dispatching to the
PCM transfer helpers, and snd_pcm_common_ioctl() still samples the
DISCONNECTED state directly in its common precheck.

Use snd_pcm_get_state() for those ioctl-side prechecks as well. This keeps
the externally visible ioctl entry checks consistent with the stream-locked
state access used by the recent PCM state-read cleanup.

Fixes: 032322b44c02 ("ALSA: pcm: oss: use proper stream lock for runtime->state access")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260605-alsa-pcm-xfer-state-helper-v1-1-eba97cecf820@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_compat.c
sound/core/pcm_native.c