Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6b84ffb authored by Takashi Sakamoto's avatar Takashi Sakamoto Committed by Takashi Iwai
Browse files

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: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d173265a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -247,14 +247,15 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)
{
	struct snd_efw *efw = substream->private_data;

	if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN) {
	mutex_lock(&efw->mutex);

	if (substream->runtime->status->state != SNDRV_PCM_STATE_OPEN)
		--efw->substreams_counter;
		mutex_unlock(&efw->mutex);
	}

	snd_efw_stream_stop_duplex(efw);

	mutex_unlock(&efw->mutex);

	return snd_pcm_lib_free_vmalloc_buffer(substream);
}