aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-05-09 21:12:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 11:13:52 +0200
commit00450ed03a17143e2433b461a656ef9cd17c2f1d (patch)
treed9b2c4f1bb60ac15c414ec26d08db50963896b0f
parenta941105525cbcc24d81e284112c26c551b6d6d87 (diff)
downloadlinux-yocto-00450ed03a17143e2433b461a656ef9cd17c2f1d.tar.gz
linux-yocto-00450ed03a17143e2433b461a656ef9cd17c2f1d.tar.bz2
linux-yocto-00450ed03a17143e2433b461a656ef9cd17c2f1d.zip
spi: spi-fsl-dspi: Fix a resource leak in an error handling path
commit 680ec0549a055eb464dce6ffb4bfb736ef87236e upstream '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> Link: https://lore.kernel.org/r/d51caaac747277a1099ba8dea07acd85435b857e.1620587472.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org> [sudip: adjust context] Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/spi/spi-fsl-dspi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index 1b003dba86f9..25486ee8379b 100644
--- a/drivers/spi/spi-fsl-dspi.c
+++ b/drivers/spi/spi-fsl-dspi.c
@@ -1124,11 +1124,13 @@ static int dspi_probe(struct platform_device *pdev)
ret = spi_register_master(master);
if (ret != 0) {
dev_err(&pdev->dev, "Problem registering DSPI master\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);