[PATCH v2 0/2] ASoC: mediatek: mt8173: Fix error paths
ASoC: mediatek: mt8173, presented a couple of error paths errors, lets fix them.
Signed-off-by: Ricardo Ribalda Delgado ribalda@chromium.org --- Changes in v2: - Fix other error paths bugs, Thanks Dan! - Link to v1: https://lore.kernel.org/r/20230612-mt8173-fixup-v1-1-81f5c90316d1@chromium.o...
--- Ricardo Ribalda Delgado (2): ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path ASoC: mediatek: mt8173: Fix irq error path
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- base-commit: 858fd168a95c5b9669aac8db6c14a9aeab446375 change-id: 20230612-mt8173-fixup-bc602a96dbad
Best regards,
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 --- 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";
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 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
After reordering the irq probe, the error path was not properly done. Lets fix it.
Reported-by: Dan Carpenter dan.carpenter@linaro.org Cc: stable@kernel.org Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") Signed-off-by: Ricardo Ribalda Delgado ribalda@chromium.org --- sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c index ff25c44070a3..06269f7e3756 100644 --- a/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c +++ b/sound/soc/mediatek/mt8173/mt8173-afe-pcm.c @@ -1070,6 +1070,10 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev)
afe->dev = &pdev->dev;
+ irq_id = platform_get_irq(pdev, 0); + if (irq_id <= 0) + return irq_id < 0 ? irq_id : -ENXIO; + afe->base_addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(afe->base_addr)) return PTR_ERR(afe->base_addr); @@ -1175,14 +1179,11 @@ static int mt8173_afe_pcm_dev_probe(struct platform_device *pdev) if (ret) goto err_cleanup_components;
- irq_id = platform_get_irq(pdev, 0); - if (irq_id <= 0) - return irq_id < 0 ? irq_id : -ENXIO; ret = devm_request_irq(afe->dev, irq_id, mt8173_afe_irq_handler, 0, "Afe_ISR_Handle", (void *)afe); if (ret) { dev_err(afe->dev, "could not request_irq\n"); - goto err_pm_disable; + goto err_cleanup_components; }
dev_info(&pdev->dev, "MT8173 AFE driver initialized.\n");
Il 12/06/23 11:05, Ricardo Ribalda Delgado ha scritto:
After reordering the irq probe, the error path was not properly done. Lets fix it.
Reported-by: Dan Carpenter dan.carpenter@linaro.org Cc: stable@kernel.org Fixes: 4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready") Signed-off-by: Ricardo Ribalda Delgado ribalda@chromium.org
Reviewed-by: AngeloGioacchino Del Regno angelogioacchino.delregno@collabora.com
On Mon, 12 Jun 2023 11:05:30 +0200, Ricardo Ribalda Delgado wrote:
ASoC: mediatek: mt8173, presented a couple of error paths errors, lets fix them.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path commit: a46d37012a5be1737393b8f82fd35665e4556eee [2/2] ASoC: mediatek: mt8173: Fix irq error path commit: f9c058d14f4fe23ef523a7ff73734d51c151683c
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (3)
-
AngeloGioacchino Del Regno
-
Mark Brown
-
Ricardo Ribalda Delgado