Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp443323pxj; Thu, 17 Jun 2021 06:23:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTIHCQJzGW8QpPFT14tawMy54XrAu+T6w6Ns1ks6cDXw706Y2bQP4fM1pqky/7uqSWUA9j X-Received: by 2002:a02:620a:: with SMTP id d10mr4805624jac.22.1623936195343; Thu, 17 Jun 2021 06:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623936195; cv=none; d=google.com; s=arc-20160816; b=mnF/KQJY8rCvFBoYK0jIGa5acTSpp85FNoBNgrtS/t3Vtt4SVNMhG/AcxuR2AciVdn TlNUr7k5GSFnW5/sQlaqQifcz/eImA5dy9X0xMvPeqLtnExTd1fLn+wuhKlvsTHXMnHb ruNW+9g0J3lCJ0lWzhWoJOJM7+vtTOycz83wpNcO+WjzaH+q/Q8fRgU5PGt+fv8VKf2c /MFApDKwsKj3kfhJ5A+ins5c6lgqCpILT/hIX4FRjTORsCd+HaLRVgeGyYZz4hDixAD8 hKUprfVRuY3gbgMdGFt2AtpZ+JowU+CyscrhjagDkHwM9ujUdKBVQybESOfH7O0359Tt qicw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=oxhrS2kmolyTUuW7L4o6sVC6/uz5M4qYov6JWthbW54=; b=O0P35+l4/baQvtRdl3HM5aXlzcOgva960LlhSDmBM0y7tbf3U2+C5jTlFvivQDZ8nk bgJpzAsDtqCpbsiP4VNLv3PrD3bqkHHD8LLWa3eSeHfuaeyZ9wEZqDW5VBrR5zHLJczU qEcs2eWPQ/q8WmeBy+/Una5njb4TIIYOliOKRrKQ5tEs7kRL3haPIIS7KYs28zo9UNXp Gu9mlYe58nTj+B1iKRC3q665Wg7DMMSfqzxt5sxmXtRIE+D3UeD0+cDn+Pf4dj4iW2YL sh+fBVKhtvXvHMKNm+rhEh+ok97dhwCygz124vNH4bApgrieJZO9SZWmEE6LNiq6OAjH byIw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si5722552ioo.56.2021.06.17.06.23.03; Thu, 17 Jun 2021 06:23:15 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232370AbhFQLOW (ORCPT + 99 others); Thu, 17 Jun 2021 07:14:22 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7352 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231501AbhFQLOU (ORCPT ); Thu, 17 Jun 2021 07:14:20 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G5K6L397xz6yGm; Thu, 17 Jun 2021 19:08:10 +0800 (CST) Received: from dggemi762-chm.china.huawei.com (10.1.198.148) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 17 Jun 2021 19:12:10 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by dggemi762-chm.china.huawei.com (10.1.198.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 17 Jun 2021 19:12:09 +0800 From: Zou Wei To: , , , , , CC: , , , Zou Wei Subject: [PATCH -next] ASoC: tegra: Fix missing clk_disable_unprepare() on error path Date: Thu, 17 Jun 2021 19:30:39 +0800 Message-ID: <1623929439-4289-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggemi762-chm.china.huawei.com (10.1.198.148) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the missing clk_disable_unprepare() before return from tegra_machine_hw_params() in the error handling case. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- sound/soc/tegra/tegra_asoc_machine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_asoc_machine.c b/sound/soc/tegra/tegra_asoc_machine.c index a53aec3..397f326 100644 --- a/sound/soc/tegra/tegra_asoc_machine.c +++ b/sound/soc/tegra/tegra_asoc_machine.c @@ -306,6 +306,7 @@ static int tegra_machine_hw_params(struct snd_pcm_substream *substream, err = snd_soc_dai_set_sysclk(codec_dai, clk_id, mclk, SND_SOC_CLOCK_IN); if (err < 0) { + clk_disable_unprepare(machine->clk_cdev1); dev_err(card->dev, "codec_dai clock not set: %d\n", err); return err; } @@ -523,8 +524,10 @@ int tegra_asoc_machine_probe(struct platform_device *pdev) } err = devm_snd_soc_register_card(dev, card); - if (err) + if (err) { + clk_disable_unprepare(machine->clk_cdev1); return err; + } return 0; } -- 2.6.2