Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp476844pxt; Fri, 6 Aug 2021 06:36:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypR697B4Ye61fXWwkhwjAnm+KF9guAguySNglSc27tYt9EapO7VJiAnAFJISceWx+2Zd9Z X-Received: by 2002:a17:907:1006:: with SMTP id ox6mr9974329ejb.476.1628257006145; Fri, 06 Aug 2021 06:36:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628257006; cv=none; d=google.com; s=arc-20160816; b=AfFp2niC7pzXlLG8VfapRvdmLhgUcx+27fJEgGQTOa/jW9UR1Vub19OmtI1FJNhvfj SXoBnf09TMTnwtoz8pKLELyWxwaiaVApb9XapHE84Bprtajndl1DSkPf8+VXpOu0nByH jeAmNTQWIy+M49KB2imNvNMjBu8zR7jjMCvwcoyJckqeJh0dRjlZa7n7TwSRsg388BBk 6P5g/rRP53FWO4EGpaRNmDy3yAPwlJ7ND4Xx5RxAhG2zTtXRVlssTfkkCCXnQ5M0e/U2 kMcky64006ZpYFqn6t/5JBjYLwUsSAVCnS61aDRyKRq1Mb/I7J0iWo/GPXgc8tMXxgPn 9R8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d+0FRJ2vunl1nnxh2EWIHsjqPKJFogSd+I0WBr44WVc=; b=dc8Be/Iij0ICHcMb1pRrKzhVtU+p3Pk5EKW0hgbYc+1Hl5F0InPw+dO+Gccl8XvMAy xxkAYhaL2FAuDtwGTctHQIAIfK4QOqyZeTYNGOGQyamYw6udPvHVAdeCWInRfHDazpBI Z2AOur5ztSrZiffnoQx95gVI75ZzBjc85xS7ux8Jh+tnyugNbrKrsrUw4OXH09ciwKOB CqeIyUJjgn8+zOO+SX83Tcpl5vjqm2VVPa73xJNkGIK4jnkdgpLKGyhRmorO48+Wk3Nf rnTkMigCbPSUKhgK0rl+IUtYDcWevU2DAAEJWH6vG8ZJnSW6Y+chTjWe/RuW8zXj0In7 VLSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cfq3rmL2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si8862621edr.406.2021.08.06.06.36.22; Fri, 06 Aug 2021 06:36:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cfq3rmL2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243524AbhHFIVd (ORCPT + 99 others); Fri, 6 Aug 2021 04:21:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:47214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243819AbhHFITD (ORCPT ); Fri, 6 Aug 2021 04:19:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 960AF61131; Fri, 6 Aug 2021 08:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628237922; bh=9Ekw3+9sj0iwmU+tEstdxAwWf8wSv4kj+Ikag/p3grk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cfq3rmL2BAe95FC1OVUGBFmoyS1ReVQ3uSWEoF8796NSBUGCmR/UZJeBRLAP4tESF r3lR/Di5RjP61X6u+noUK/CFVdWvW2vduLkSa13rE4QMUYQrL5MUpyTNciSPIxa5Dy QXqW8iJA7n+2Uxv9D9vOTmELeG47J3JIXiR83HfY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Mark Brown , Sasha Levin Subject: [PATCH 5.10 13/30] ASoC: ti: j721e-evm: Fix unbalanced domain activity tracking during startup Date: Fri, 6 Aug 2021 10:16:51 +0200 Message-Id: <20210806081113.583966316@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.126861800@linuxfoundation.org> References: <20210806081113.126861800@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Ujfalusi [ Upstream commit 78d2a05ef22e7b5863b01e073dd6a06b3979bb00 ] In case of an error within j721e_audio_startup() the domain->active must be decremented to avoid unbalanced counter. Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20210717122820.1467-2-peter.ujfalusi@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/ti/j721e-evm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sound/soc/ti/j721e-evm.c b/sound/soc/ti/j721e-evm.c index a7c0484d44ec..017c4ad11ca6 100644 --- a/sound/soc/ti/j721e-evm.c +++ b/sound/soc/ti/j721e-evm.c @@ -278,23 +278,29 @@ static int j721e_audio_startup(struct snd_pcm_substream *substream) j721e_rule_rate, &priv->rate_range, SNDRV_PCM_HW_PARAM_RATE, -1); - mutex_unlock(&priv->mutex); if (ret) - return ret; + goto out; /* Reset TDM slots to 32 */ ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 32); if (ret && ret != -ENOTSUPP) - return ret; + goto out; for_each_rtd_codec_dais(rtd, i, codec_dai) { ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 2, 32); if (ret && ret != -ENOTSUPP) - return ret; + goto out; } - return 0; + if (ret == -ENOTSUPP) + ret = 0; +out: + if (ret) + domain->active--; + mutex_unlock(&priv->mutex); + + return ret; } static int j721e_audio_hw_params(struct snd_pcm_substream *substream, -- 2.30.2