Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1880326ybz; Sun, 26 Apr 2020 06:20:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLftNCt8pywFDmPwEzKwloENWezyXIZHLkVqA1ZqzVZLNd0di2Ww13tzGivY1OcaCNTuqDO X-Received: by 2002:a17:906:328f:: with SMTP id 15mr16068041ejw.33.1587907246063; Sun, 26 Apr 2020 06:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587907246; cv=none; d=google.com; s=arc-20160816; b=UyXm0It4VPaLuH2WG3vH7Vo5etum4O/W89fPhIWG9phyh/M0Newm5fiAfoa1L/u+sZ 2tLc3iKKIYz3tU6GsmrosiwH/r30rV18pRSVj9z150Wtdw8ota2Z//lrNLvudpmbsUrl mxG0MEapAanmjcn3seD8qYrEuOUcteqG19oSemafR5+20HSs0IEN8x8//G5ht4lkJr0g GIWzQZ+Y9jeK0cjVq+OhANvn+gYjJw8/nv3ZZrwjom59X7y0mb/2S4/LH6h2UvYmaz95 lt2XuFHcntBc1n8UJF6+/JhVXo6LMPg/Pxe3tU8io/+w92tQ+oQPDtfOwzha6lmkGSrn 4rJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=sHtftG+loZoss3bQrC65bdbneZ0xqxISeBkwOOljNl0=; b=qM11xpMJi27FqBqZUu2inpu/Wi5MeRkTuG7ggt2gBMGUtgPDJtDB2LAgqIFNsEZi/7 HpGv41PSn/FT92ktJD0rPp/gPbSVGWfo2Iw4OOIn48Mk2ll9zQgy5GTJSWyHMcq93UTA MNXDRf68x7+ddgQ9CT1KX2z1INuO5KV1hrE86mxk5349mAeIHcHAz6DaQs3+eWmTi7cQ AgW+K+gFrqwQ0AfT9XtIcO9NQ35Zs3thPUlFyc/vsRLf+7UO+wAjOD/GlwZXcx5Nw+jc 3hCSNVjIJdHg1ALPQ7k6F7e56yT7fSCuunDbW5M1HMygzM9qmknognd0O9GbFkWJMHHv mibg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn23si6828627ejb.331.2020.04.26.06.20.23; Sun, 26 Apr 2020 06:20: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726185AbgDZNSZ (ORCPT + 99 others); Sun, 26 Apr 2020 09:18:25 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59692 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725876AbgDZNSZ (ORCPT ); Sun, 26 Apr 2020 09:18:25 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id F0527690B6900E72B260; Sun, 26 Apr 2020 21:18:22 +0800 (CST) Received: from huawei.com (10.175.105.27) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Sun, 26 Apr 2020 21:18:13 +0800 From: Wu Bo To: , , , , , , CC: , , , , Subject: [PATCH] sound:hdmi:fix without unlocked before return Date: Sun, 26 Apr 2020 21:17:22 +0800 Message-ID: <1587907042-694161-1-git-send-email-wubo40@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.105.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: sound/pci/hda/patch_hdmi.c:1852:2-8: preceding lock on line 1846 After add sanity check to pass klockwork check, The spdif_mutex should be unlock before return true in check_non_pcm_per_cvt(). Signed-off-by: Wu Bo --- sound/pci/hda/patch_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 4eff1605..c24832b 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1848,8 +1848,10 @@ static bool check_non_pcm_per_cvt(struct hda_codec *codec, hda_nid_t cvt_nid) /* Add sanity check to pass klockwork check. * This should never happen. */ - if (WARN_ON(spdif == NULL)) + if (WARN_ON(spdif == NULL)) { + mutex_unlock(&codec->spdif_mutex); return true; + } non_pcm = !!(spdif->status & IEC958_AES0_NONAUDIO); mutex_unlock(&codec->spdif_mutex); return non_pcm; -- 1.8.3.1