summaryrefslogtreecommitdiffstats
path: root/sound/sparc
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-11-11 22:21:33 +0800
committerTakashi Iwai <tiwai@suse.de>2013-11-11 16:23:16 +0100
commita522409e9ce4605989bfe87793a2f09b00474e94 (patch)
tree9cd9f92b4a89810b62f993a29a3bd56f99d0e0d4 /sound/sparc
parent0c52db8cca7b033d03ebcda652158e2311d5ac64 (diff)
downloadlinux-a522409e9ce4605989bfe87793a2f09b00474e94.tar.gz
linux-a522409e9ce4605989bfe87793a2f09b00474e94.tar.bz2
linux-a522409e9ce4605989bfe87793a2f09b00474e94.zip
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: 5a19b178d7b4 ('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>
Diffstat (limited to 'sound/sparc')
-rw-r--r--sound/sparc/cs4231.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index b47f6fe6277f..dbb1b625eb2f 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -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_pcm_runtime *runtime = substream->runtime;
unsigned long flags;
+ int ret = 0;
spin_lock_irqsave(&chip->lock, flags);
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
CS4231_PLAYBACK_PIO);
- if (WARN_ON(runtime->period_size > 0xffff + 1))
- return -EINVAL;
+ if (WARN_ON(runtime->period_size > 0xffff + 1)) {
+ ret = -EINVAL;
+ goto out;
+ }
chip->p_periods_sent = 0;
+
+out:
spin_unlock_irqrestore(&chip->lock, flags);
- return 0;
+ return ret;
}
static int snd_cs4231_capture_hw_params(struct snd_pcm_substream *substream,