Commit 5e818ac2 authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai

ALSA: bebob: change the range of critical section for stream data in PCM.hw_free callback

The operation of duplex streams should be in critical section.
Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 73f7864e
...@@ -213,14 +213,15 @@ static int pcm_hw_free(struct snd_pcm_substream *substream) ...@@ -213,14 +213,15 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
{ {
struct snd_bebob *bebob = substream->private_data; struct snd_bebob *bebob = substream->private_data;
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) { mutex_lock(&bebob->mutex);
mutex_lock(&bebob->mutex);
if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
bebob->substreams_counter--; bebob->substreams_counter--;
mutex_unlock(&bebob->mutex);
}
snd_bebob_stream_stop_duplex(bebob); snd_bebob_stream_stop_duplex(bebob);
mutex_unlock(&bebob->mutex);
return snd_pcm_lib_free_vmalloc_buffer(substream); return snd_pcm_lib_free_vmalloc_buffer(substream);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment