ASoC: dapm: Add missing mutex unlock
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Fri, 8 May 2015 09:50:10 +0000 (10:50 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 8 May 2015 10:24:22 +0000 (11:24 +0100)
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>
sound/soc/soc-dapm.c

index a2e5f2278caa7da4765087bc27b488d35bd5a22c..765416174388edfcd64cac5f599c005faa6c3aa1 100644 (file)
@@ -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);
        }