From: Zou Wei <zou_wei@huawei.com>
To: <lgirdwood@gmail.com>, <broonie@kernel.org>, <perex@perex.cz>,
<tiwai@suse.com>, <thierry.reding@gmail.com>,
<jonathanh@nvidia.com>
Cc: <alsa-devel@alsa-project.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Zou Wei <zou_wei@huawei.com>
Subject: [PATCH -next] ASoC: tegra: Fix missing clk_disable_unprepare() on error path
Date: Thu, 17 Jun 2021 19:30:39 +0800 [thread overview]
Message-ID: <1623929439-4289-1-git-send-email-zou_wei@huawei.com> (raw)
Fix the missing clk_disable_unprepare() before return
from tegra_machine_hw_params() in the error handling case.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
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
next reply other threads:[~2021-06-17 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 11:30 Zou Wei [this message]
2021-06-17 12:46 ` Dmitry Osipenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1623929439-4289-1-git-send-email-zou_wei@huawei.com \
--to=zou_wei@huawei.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=perex@perex.cz \
--cc=thierry.reding@gmail.com \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®