summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-pic32.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2020-11-08 23:41:00 +0100
committerMark Brown <broonie@kernel.org>2020-11-12 15:16:34 +0000
commitc575e9113bff5e024d75481613faed5ef9d465b2 (patch)
treee8f09d9f075a2da93f864c6aecbf6c30bfbd5bc9 /drivers/spi/spi-pic32.c
parent8853b2503014aca5c793d2c7f0aabc990b32bdad (diff)
spi: pic32: Don't leak DMA channels in probe error path
If the calls to devm_request_irq() or devm_spi_register_master() fail on probe of the PIC32 SPI driver, the DMA channels requested by pic32_spi_dma_prep() are erroneously not released. Plug the leak. Fixes: 1bcb9f8ceb67 ("spi: spi-pic32: Add PIC32 SPI master driver") Signed-off-by: Lukas Wunner <lukas@wunner.de> Cc: <stable@vger.kernel.org> # v4.7+ Cc: Purna Chandra Mandal <purna.mandal@microchip.com> Link: https://lore.kernel.org/r/9624250e3a7aa61274b38219a62375bac1def637.1604874488.git.lukas@wunner.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-pic32.c')
-rw-r--r--drivers/spi/spi-pic32.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spi-pic32.c b/drivers/spi/spi-pic32.c
index 156961b4ca86..104bde153efd 100644
--- a/drivers/spi/spi-pic32.c
+++ b/drivers/spi/spi-pic32.c
@@ -839,6 +839,7 @@ static int pic32_spi_probe(struct platform_device *pdev)
return 0;
err_bailout:
+ pic32_spi_dma_unprep(pic32s);
clk_disable_unprepare(pic32s->clk);
err_master:
spi_master_put(master);