2023-06-12 09:32:11

by Ricardo Ribalda

[permalink] [raw]
Subject: [PATCH v2 1/2] 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 <[email protected]>
Cc: [email protected]
Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component")
Signed-off-by: Ricardo Ribalda Delgado <[email protected]>
---
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 4 ++--
1 file 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";

--
2.41.0.162.gfafddb0af9-goog



Subject: Re: [PATCH v2 1/2] ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path

Il 12/06/23 11:05, Ricardo Ribalda Delgado ha scritto:
> If the second component fails to initialize, cleanup the first on.
>
> Reported-by: Dan Carpenter <[email protected]>
> Cc: [email protected]
> Fixes: f1b5bf07365d ("ASoC: mt2701/mt8173: replace platform to component")
> Signed-off-by: Ricardo Ribalda Delgado <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>