* [PATCH] ASoC: mediatek: mt8173: Fix error path
@ 2023-06-12 7:49 Ricardo Ribalda Delgado
2023-06-12 8:12 ` Dan Carpenter
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Ribalda Delgado @ 2023-06-12 7:49 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Matthias Brugger, AngeloGioacchino Del Regno
Cc: alsa-devel, linux-kernel, linux-arm-kernel, linux-mediatek,
Dan Carpenter, stable, Ricardo Ribalda Delgado
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>
---
4cbb264d4e91 ("ASoC: mediatek: mt8173: Enable IRQ when pdata is ready")
introduced a bug on the probe error path.
Lets fix it.
---
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 f93c2ec8beb7..f2fdcc74069a 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");
---
base-commit: 858fd168a95c5b9669aac8db6c14a9aeab446375
change-id: 20230612-mt8173-fixup-bc602a96dbad
Best regards,
--
Ricardo Ribalda Delgado <ribalda@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] ASoC: mediatek: mt8173: Fix error path
2023-06-12 7:49 [PATCH] ASoC: mediatek: mt8173: Fix error path Ricardo Ribalda Delgado
@ 2023-06-12 8:12 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2023-06-12 8:12 UTC (permalink / raw)
To: Ricardo Ribalda Delgado
Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Matthias Brugger, AngeloGioacchino Del Regno, alsa-devel,
linux-kernel, linux-arm-kernel, linux-mediatek, stable
On Mon, Jun 12, 2023 at 09:49:32AM +0200, Ricardo Ribalda Delgado wrote:
> @@ -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;
Hm... I hadn't noticed that. You're right, but I don't think your
patch goes far enough. I think everything after the first
successful call to snd_soc_add_component() should be goto
err_cleanup_components;
But I am not 100% sure.
regards,
dan carpenter
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-12 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-12 7:49 [PATCH] ASoC: mediatek: mt8173: Fix error path Ricardo Ribalda Delgado
2023-06-12 8:12 ` Dan Carpenter
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®