Skip to content

Commit 9ff3483

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: fix double unlocked 'motu->mutex'
Mutex is doubly unlocked in some error path of pcm.open. This commit fixes ALSA firewire-motu driver in Linux kernel v5.5. Reported-by: kbuild test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 3fd80b2 ("ALSA: firewire-motu: use the same size of period for PCM substream in AMDTP streams") Fixes: 0f5482e ("ALSA: firewire-motu: share PCM buffer size for both direction") Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Link: https://lore.kernel.org/r/20191208232226.6685-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c08f0a9 commit 9ff3483

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

sound/firewire/motu/motu-pcm.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,14 @@ static int pcm_open(struct snd_pcm_substream *substream)
177177
err = snd_pcm_hw_constraint_minmax(substream->runtime,
178178
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
179179
frames_per_period, frames_per_period);
180-
if (err < 0) {
181-
mutex_unlock(&motu->mutex);
180+
if (err < 0)
182181
goto err_locked;
183-
}
184182

185183
err = snd_pcm_hw_constraint_minmax(substream->runtime,
186184
SNDRV_PCM_HW_PARAM_BUFFER_SIZE,
187185
frames_per_buffer, frames_per_buffer);
188-
if (err < 0) {
189-
mutex_unlock(&motu->mutex);
186+
if (err < 0)
190187
goto err_locked;
191-
}
192188
}
193189
}
194190

0 commit comments

Comments
 (0)