summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2019-06-15 05:11:00 -0400
committerTakashi Iwai <tiwai@suse.de>2019-06-17 02:18:36 -0400
commitc6b84ffbd5e78d6cf4aaafe5502e1bc99eb9657c (patch)
tree6562084e126efb6303eeb9b0ca6f991a7ade1c56
parentd173265ae36f8f6f76a507e2f529c351671269c0 (diff)
ALSA: fireworks: 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>
-rw-r--r--sound/firewire/fireworks/fireworks_pcm.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c
index 287fc05d5917..8dc34249a1b0 100644
--- a/sound/firewire/fireworks/fireworks_pcm.c
+++ b/sound/firewire/fireworks/fireworks_pcm.c
@@ -247,14 +247,15 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
247{ 247{
248 struct snd_efw *efw = substream->private_data; 248 struct snd_efw *efw = substream->private_data;
249 249
250 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) { 250 mutex_lock(&efw->mutex);
251 mutex_lock(&efw->mutex); 251
252 if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
252 --efw->substreams_counter; 253 --efw->substreams_counter;
253 mutex_unlock(&efw->mutex);
254 }
255 254
256 snd_efw_stream_stop_duplex(efw); 255 snd_efw_stream_stop_duplex(efw);
257 256
257 mutex_unlock(&efw->mutex);
258
258 return snd_pcm_lib_free_vmalloc_buffer(substream); 259 return snd_pcm_lib_free_vmalloc_buffer(substream);
259} 260}
260 261