All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path
@ 2021-05-09 19:12 Christophe JAILLET
  2021-05-09 19:26 ` Vladimir Oltean
  2021-05-11  8:25 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-05-09 19:12 UTC (permalink / raw)
  To: olteanv, broonie, maitysanchayan
  Cc: linux-spi, linux-kernel, kernel-janitors, Christophe JAILLET

'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the
error handling path of the probe function, as already done in the remove
function

Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/spi/spi-fsl-dspi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 028736687488..fb45e6af6638 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1375,11 +1375,13 @@ static int dspi_probe(struct platform_device *pdev)
 	ret = spi_register_controller(ctlr);
 	if (ret != 0) {
 		dev_err(&pdev->dev, "Problem registering DSPI ctlr\n");
-		goto out_free_irq;
+		goto out_release_dma;
 	}
 
 	return ret;
 
+out_release_dma:
+	dspi_release_dma(dspi);
 out_free_irq:
 	if (dspi->irq)
 		free_irq(dspi->irq, dspi);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path
  2021-05-09 19:12 [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Christophe JAILLET
@ 2021-05-09 19:26 ` Vladimir Oltean
  2021-05-11  8:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2021-05-09 19:26 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: broonie, maitysanchayan, linux-spi, linux-kernel, kernel-janitors

On Sun, May 09, 2021 at 09:12:27PM +0200, Christophe JAILLET wrote:
> 'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the
> error handling path of the probe function, as already done in the remove
> function
> 
> Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path
  2021-05-09 19:12 [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Christophe JAILLET
  2021-05-09 19:26 ` Vladimir Oltean
@ 2021-05-11  8:25 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-05-11  8:25 UTC (permalink / raw)
  To: Christophe JAILLET, maitysanchayan, olteanv
  Cc: Mark Brown, linux-kernel, linux-spi, kernel-janitors

On Sun, 9 May 2021 21:12:27 +0200, Christophe JAILLET wrote:
> 'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the
> error handling path of the probe function, as already done in the remove
> function

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: spi-fsl-dspi: Fix a resource leak in an error handling path
      commit: 680ec0549a055eb464dce6ffb4bfb736ef87236e

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-11  8:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 19:12 [PATCH] spi: spi-fsl-dspi: Fix a resource leak in an error handling path Christophe JAILLET
2021-05-09 19:26 ` Vladimir Oltean
2021-05-11  8:25 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.