summaryrefslogtreecommitdiff
path: root/sound/soc/mediatek
diff options
context:
space:
mode:
authorRicardo Ribalda Delgado <ribalda@chromium.org>2023-06-12 11:05:31 +0200
committerMark Brown <broonie@kernel.org>2023-06-12 14:47:45 +0100
commita46d37012a5be1737393b8f82fd35665e4556eee (patch)
tree853e2336f04427a7e40db5e839b017f70255657d /sound/soc/mediatek
parent62a97bea5cce5317d6d7630f7bcf0cdf5333e269 (diff)
ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path
If the second component fails to initialize, cleanup the first on. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Cc: stable@kernel.org Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component") Signed-off-by: Ricardo Ribalda Delgado <ribalda@chromium.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek')
-rw-r--r--sound/soc/mediatek/mt8173/mt8173-afe-pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
index f93c2ec8beb7..ff25c44070a3 100644
--- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
+++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c
@@ -1156,14 +1156,14 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
comp_hdmi = devm_kzalloc(&pdev->dev, sizeof(*comp_hdmi), GFP_KERNEL);
if (!comp_hdmi) {
ret = -ENOMEM;
- goto err_pm_disable;
+ goto err_cleanup_components;
}
ret = snd_soc_component_initialize(comp_hdmi,
&mt8173_afe_hdmi_dai_component,
&pdev->dev);
if (ret)
- goto err_pm_disable;
+ goto err_cleanup_components;
#ifdef CONFIG_DEBUG_FS
comp_hdmi->debugfs_prefix = "hdmi";