From patchwork Fri Nov 18 11:56:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 9436313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6201960469 for ; Fri, 18 Nov 2016 12:02:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46365287DE for ; Fri, 18 Nov 2016 12:02:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3936B2989D; Fri, 18 Nov 2016 12:02:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D169C287DE for ; Fri, 18 Nov 2016 12:02:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 40ABF266DCE; Fri, 18 Nov 2016 13:02:12 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C6633266735; Fri, 18 Nov 2016 12:59:51 +0100 (CET) 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 BFE68266DCE; Fri, 18 Nov 2016 12:56:31 +0100 (CET) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by alsa0.perex.cz (Postfix) with ESMTP id D6789266DBD for ; Fri, 18 Nov 2016 12:56:29 +0100 (CET) Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uAIBuR43014666 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Nov 2016 11:56:27 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.13.8) with ESMTP id uAIBuQXN006043 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 18 Nov 2016 11:56:26 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uAIBuOIH004754; Fri, 18 Nov 2016 11:56:24 GMT Received: from mwanda (/154.122.64.111) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 18 Nov 2016 03:56:23 -0800 Date: Fri, 18 Nov 2016 14:56:11 +0300 From: Dan Carpenter To: Bard Liao Message-ID: <20161118115611.GA3784@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: Oder Chiou , alsa-devel@alsa-project.org, kernel-janitors@vger.kernel.org, Takashi Iwai , Liam Girdwood , Mark Brown Subject: [alsa-devel] [patch] ASoC: rt5665: Unlock on error in rt5665_calibrate() 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP We should probably unlock before returning here. Fixes: 33ada14a26c8 ("ASoC: add rt5665 codec driver") Signed-off-by: Dan Carpenter diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 34254fd..25bd01b 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -4587,7 +4587,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665) pr_err("HP Calibration Failure\n"); regmap_write(rt5665->regmap, RT5665_RESET, 0); regcache_cache_bypass(rt5665->regmap, false); - return; + goto unlock; } count++; @@ -4606,7 +4606,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665) pr_err("MONO Calibration Failure\n"); regmap_write(rt5665->regmap, RT5665_RESET, 0); regcache_cache_bypass(rt5665->regmap, false); - return; + goto unlock; } count++; @@ -4620,7 +4620,7 @@ static void rt5665_calibrate(struct rt5665_priv *rt5665) regmap_write(rt5665->regmap, RT5665_BIAS_CUR_CTRL_8, 0xa602); regmap_write(rt5665->regmap, RT5665_ASRC_8, 0x0120); - +unlock: mutex_unlock(&rt5665->calibrate_mutex); }