summaryrefslogtreecommitdiffstats
path: root/sound/firewire
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-15 05:10:58 -0400
committerTakashi Iwai <tiwai@suse.de>2019-06-17 02:18:35 -0400
commit5e818ac21f9d48a52955e68b96148a3b18f60c09 (patch)
tree169e99629e4977bcd7e17aaa4bfddf4596dd17f6 /sound/firewire
parent73f7864eb5f00cc1a7a3936b5f7b170886851874 (diff)
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: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire')
-rw-r--r--sound/firewire/bebob/bebob_pcm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c
index 530db7a7844c..e21de44deaa9 100644
--- a/sound/firewire/bebob/bebob_pcm.c
+++ b/sound/firewire/bebob/bebob_pcm.c
@@ -213,14 +213,15 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
213{ 213{
214 struct snd_bebob *bebob = substream->private_data; 214 struct snd_bebob *bebob = substream->private_data;
215 215
216 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) { 216 mutex_lock(&bebob->mutex);
217 mutex_lock(&bebob->mutex); 217
218 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
218 bebob->substreams_counter--; 219 bebob->substreams_counter--;
219 mutex_unlock(&bebob->mutex);
220 }
221 220
222 snd_bebob_stream_stop_duplex(bebob); 221 snd_bebob_stream_stop_duplex(bebob);
223 222
223 mutex_unlock(&bebob->mutex);
224
224 return snd_pcm_lib_free_vmalloc_buffer(substream); 225 return snd_pcm_lib_free_vmalloc_buffer(substream);
225} 226}
226 227