Re: Re: Re: [PATCH] ALSA: pcm: Show closed for DISCONNECTED state

From: Ai Chao

Date: Fri Jun 19 2026 - 05:30:04 EST


Hello Takashi

> Right, I suspect that it might be the case.
> Does the change like below help (or worsen) anything?

We tested this solution and verified its feasibility.

Thanks,
Ai Chao

--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -3907,6 +3907,8 @@ static vm_fault_t snd_pcm_mmap_data_fault(struct vm_fault *vmf)
if (substream == NULL)
return VM_FAULT_SIGBUS;
runtime = substream->runtime;
+ if (runtime->state == SNDRV_PCM_STATE_DISCONNECTED)
+ return VM_FAULT_SIGBUS;
offset = vmf->pgoff << PAGE_SHIFT;
dma_bytes = PAGE_ALIGN(runtime->dma_bytes);
if (offset > dma_bytes - PAGE_SIZE)