Re: [PATCH] ALSA: pcm: Fix unlocked runtime state reads in xfer ioctls
From: Takashi Iwai
Date: Sat Jun 06 2026 - 12:18:36 EST
On Fri, 05 Jun 2026 17:48:27 +0200,
Cássio Gabriel wrote:
>
> 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@xxxxxxxxx>
Applied to for-next branch now. Thanks.
Takashi