summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2015-05-08 10:50:10 +0100
committerMark Brown <broonie@kernel.org>2015-05-08 11:24:22 +0100
commit964a0b896a7c78622801afcee77ed3d240352747 (patch)
tree3bd9169dd5032e23e5e480719acaab90fa9779ad /sound/soc/soc-dapm.c
parentd714f97c5b8c4c5da56b89a7289acb3f12ef7abb (diff)
ASoC: dapm: Add missing mutex unlock
The is a missing mutex unlock on the error path in snd_soc_dapm_get_enum_double. This was introduced in commit 561ed680b764 ("ASoC: dapm: Add support for autodisable mux controls"). This patch adds the missing unlock. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a2e5f2278caa..765416174388 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3069,8 +3069,10 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol,
mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
if (e->reg != SND_SOC_NOPM && dapm_kcontrol_is_powered(kcontrol)) {
int ret = soc_dapm_read(dapm, e->reg, &reg_val);
- if (ret)
+ if (ret) {
+ mutex_unlock(&card->dapm_mutex);
return ret;
+ }
} else {
reg_val = dapm_kcontrol_get_value(kcontrol);
}