From patchwork Fri May 8 09:50:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Keepax X-Patchwork-Id: 6363881 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 522249F1C2 for ; Fri, 8 May 2015 09:59:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DF4220219 for ; Fri, 8 May 2015 09:59:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 2B216201F5 for ; Fri, 8 May 2015 09:59:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1E130265AF0; Fri, 8 May 2015 11:59:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BAE8D265AD8; Fri, 8 May 2015 11:59:16 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8A222265AD9; Fri, 8 May 2015 11:59:15 +0200 (CEST) Received: from opensource.wolfsonmicro.com (opensource.wolfsonmicro.com [80.75.67.52]) by alsa0.perex.cz (Postfix) with ESMTP id 6B8F6265AD2 for ; Fri, 8 May 2015 11:59:08 +0200 (CEST) Received: from localhost.localdomain (unknown [87.246.78.26]) by opensource.wolfsonmicro.com (Postfix) with ESMTPSA id 8F32B3B40FF; Fri, 8 May 2015 10:59:07 +0100 (BST) From: Charles Keepax To: broonie@kernel.org Date: Fri, 8 May 2015 10:50:10 +0100 Message-Id: <1431078610-4150-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 Cc: alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, dan.carpenter@oracle.com, patches@opensource.wolfsonmicro.com Subject: [alsa-devel] [PATCH] ASoC: dapm: Add missing mutex unlock X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Charles Keepax --- sound/soc/soc-dapm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index ea3348e..6374852 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3075,8 +3075,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, ®_val); - if (ret) + if (ret) { + mutex_unlock(&card->dapm_mutex); return ret; + } } else { reg_val = dapm_kcontrol_get_value(kcontrol); }