Commit a46d3701 authored by Ricardo Ribalda Delgado's avatar Ricardo Ribalda Delgado Committed by Mark Brown

ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path

If the second component fails to initialize, cleanup the first on.
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Cc: stable@kernel.org
Fixes: f1b5bf07 ("ASoC: mt2701/mt8173: replace platform to component")
Signed-off-by: default avatarRicardo Ribalda Delgado <ribalda@chromium.org>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230612-mt8173-fixup-v2-1-432aa99ce24d@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 62a97bea
...@@ -1156,14 +1156,14 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) ...@@ -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); comp_hdmi = devm_kzalloc(&pdev->dev, sizeof(*comp_hdmi), GFP_KERNEL);
if (!comp_hdmi) { if (!comp_hdmi) {
ret = -ENOMEM; ret = -ENOMEM;
goto err_pm_disable; goto err_cleanup_components;
} }
ret = snd_soc_component_initialize(comp_hdmi, ret = snd_soc_component_initialize(comp_hdmi,
&mt8173_afe_hdmi_dai_component, &mt8173_afe_hdmi_dai_component,
&pdev->dev); &pdev->dev);
if (ret) if (ret)
goto err_pm_disable; goto err_cleanup_components;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
comp_hdmi->debugfs_prefix = "hdmi"; comp_hdmi->debugfs_prefix = "hdmi";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment