Skip to content

Commit a522409

Browse files
Wei Yongjuntiwai
authored andcommitted
ALSA: sparc: fix missing unlock on error in snd_cs4231_playback_prepare()
Add the missing unlock before return from function snd_cs4231_playback_prepare() in the error handling case. Fixes: 5a19b17 ('ALSA: sparc/cs4231: Use WARN_ON() instead of BUG_ON()') Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 0c52db8 commit a522409

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎sound/sparc/cs4231.c‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,19 +907,24 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
907907
struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
908908
struct snd_pcm_runtime *runtime = substream->runtime;
909909
unsigned long flags;
910+
int ret = 0;
910911

911912
spin_lock_irqsave(&chip->lock, flags);
912913

913914
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
914915
CS4231_PLAYBACK_PIO);
915916

916-
if (WARN_ON(runtime->period_size > 0xffff + 1))
917-
return -EINVAL;
917+
if (WARN_ON(runtime->period_size > 0xffff + 1)) {
918+
ret = -EINVAL;
919+
goto out;
920+
}
918921

919922
chip->p_periods_sent = 0;
923+
924+
out:
920925
spin_unlock_irqrestore(&chip->lock, flags);
921926

922-
return 0;
927+
return ret;
923928
}
924929

925930
static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream,

0 commit comments

Comments
 (0)