[<prev] [next>] [day] [month] [year] [list]
Message-ID: <14864a18-c256-4c7d-b064-ba1400bed894@stanley.mountain>
Date: Wed, 15 Jan 2025 09:55:12 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Biju Das <biju.das.jz@...renesas.com>
Cc: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, linux-sound@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] ASoC: renesas: rz-ssi: Clean up on error in probe()
Call rz_ssi_release_dma_channels() on these error paths to clean up from
rz_ssi_dma_request().
Fixes: 26ac471c5354 ("ASoC: sh: rz-ssi: Add SSI DMAC support")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
sound/soc/renesas/rz-ssi.c | 42 ++++++++++++++++++++++++--------------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c
index 3a0af4ca7ab6..4b3016282717 100644
--- a/sound/soc/renesas/rz-ssi.c
+++ b/sound/soc/renesas/rz-ssi.c
@@ -1150,35 +1150,47 @@ static int rz_ssi_probe(struct platform_device *pdev)
ssi->irq_rx = platform_get_irq_byname(pdev, "dma_rx");
if (ssi->irq_tx == -ENXIO && ssi->irq_rx == -ENXIO) {
ssi->irq_rt = platform_get_irq_byname(pdev, "dma_rt");
- if (ssi->irq_rt < 0)
- return ssi->irq_rt;
+ if (ssi->irq_rt < 0) {
+ ret = ssi->irq_rt;
+ goto err_release_dma_chs;
+ }
ret = devm_request_irq(dev, ssi->irq_rt,
&rz_ssi_interrupt, 0,
dev_name(dev), ssi);
- if (ret < 0)
- return dev_err_probe(dev, ret,
- "irq request error (dma_rt)\n");
+ if (ret < 0) {
+ dev_err_probe(dev, ret,
+ "irq request error (dma_rt)\n");
+ goto err_release_dma_chs;
+ }
} else {
- if (ssi->irq_tx < 0)
- return ssi->irq_tx;
+ if (ssi->irq_tx < 0) {
+ ret = ssi->irq_tx;
+ goto err_release_dma_chs;
+ }
- if (ssi->irq_rx < 0)
- return ssi->irq_rx;
+ if (ssi->irq_rx < 0) {
+ ret = ssi->irq_rx;
+ goto err_release_dma_chs;
+ }
ret = devm_request_irq(dev, ssi->irq_tx,
&rz_ssi_interrupt, 0,
dev_name(dev), ssi);
- if (ret < 0)
- return dev_err_probe(dev, ret,
- "irq request error (dma_tx)\n");
+ if (ret < 0) {
+ dev_err_probe(dev, ret,
+ "irq request error (dma_tx)\n");
+ goto err_release_dma_chs;
+ }
ret = devm_request_irq(dev, ssi->irq_rx,
&rz_ssi_interrupt, 0,
dev_name(dev), ssi);
- if (ret < 0)
- return dev_err_probe(dev, ret,
- "irq request error (dma_rx)\n");
+ if (ret < 0) {
+ dev_err_probe(dev, ret,
+ "irq request error (dma_rx)\n");
+ goto err_release_dma_chs;
+ }
}
}
--
2.45.2
Powered by blists - more mailing lists