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: 5a19b178d7
('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>
This commit is contained in:
committed by
Takashi Iwai
parent
0c52db8cca
commit
a522409e9c
@@ -907,19 +907,24 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
|
|||||||
struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
|
struct snd_cs4231 *chip = snd_pcm_substream_chip(substream);
|
||||||
struct snd_pcm_runtime *runtime = substream->runtime;
|
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
spin_lock_irqsave(&chip->lock, flags);
|
spin_lock_irqsave(&chip->lock, flags);
|
||||||
|
|
||||||
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
|
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
|
||||||
CS4231_PLAYBACK_PIO);
|
CS4231_PLAYBACK_PIO);
|
||||||
|
|
||||||
if (WARN_ON(runtime->period_size > 0xffff + 1))
|
if (WARN_ON(runtime->period_size > 0xffff + 1)) {
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
chip->p_periods_sent = 0;
|
chip->p_periods_sent = 0;
|
||||||
|
|
||||||
|
out:
|
||||||
spin_unlock_irqrestore(&chip->lock, flags);
|
spin_unlock_irqrestore(&chip->lock, flags);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream,
|
static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream,
|
||||||
|
Reference in New Issue
Block a user