From patchwork Tue Aug 11 19:37:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 6994381 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 80FCA9F344 for ; Tue, 11 Aug 2015 19:38:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3BE920558 for ; Tue, 11 Aug 2015 19:38:27 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7C340204EA for ; Tue, 11 Aug 2015 19:38:25 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7293826068D; Tue, 11 Aug 2015 21:38:24 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C0AF6260591; Tue, 11 Aug 2015 21:38:14 +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 939142605D8; Tue, 11 Aug 2015 21:38:13 +0200 (CEST) Received: from smtp-out-194.synserver.de (smtp-out-194.synserver.de [212.40.185.194]) by alsa0.perex.cz (Postfix) with ESMTP id 5EE4C26056B for ; Tue, 11 Aug 2015 21:38:06 +0200 (CEST) Received: (qmail 10164 invoked by uid 0); 11 Aug 2015 19:38:06 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 10049 Received: from ppp-188-174-94-41.dynamic.mnet-online.de (HELO lars-laptop.fritz.box) [188.174.94.41] by 217.119.54.96 with SMTP; 11 Aug 2015 19:38:05 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Tue, 11 Aug 2015 21:37:59 +0200 Message-Id: <1439321881-29476-1-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 2.1.4 Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com, Lars-Peter Clausen Subject: [alsa-devel] [PATCH v2 1/3] ASoC: dapm: dapm_dai_get_connected_widgets: Fix 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 Make sure to unlock the DAPM mutex when dapm_widget_list_create() fails. This means the function will now generate a trace_snd_soc_dapm_connected event, even if the creation of the list fails. But that was the behavior before the patch that introduced the unlock issue, so that should be fine. Fixes: 1ce43acff0c0 ("ASoC: dapm: Simplify list creation in dapm_dai_get_connected_widgets()") Reported-by: Dan Carpenter Signed-off-by: Lars-Peter Clausen --- New in v2 --- sound/soc/soc-dapm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 7482c5d..c391bfe 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1191,7 +1191,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, ret = dapm_widget_list_create(list, &widgets); if (ret) - return ret; + paths = ret; trace_snd_soc_dapm_connected(paths, stream); mutex_unlock(&card->dapm_mutex);