Skip to content

Commit 460b14b

Browse files
tititiou36broonie
authored andcommitted
spi: stm32-ospi: Fix an error handling path in stm32_ospi_probe()
If an error occurs after a successful stm32_ospi_dma_setup() call, some dma_release_channel() calls are needed to release some resources, as already done in the remove function. Fixes: 79b8a70 ("spi: stm32: Add OSPI driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Link: https://patch.msgid.link/2674c8df1d05ab312826b69bfe9559f81d125a0b.1744975624.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8ffd015 commit 460b14b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/spi/spi-stm32-ospi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,10 @@ static int stm32_ospi_probe(struct platform_device *pdev)
960960
err_pm_enable:
961961
pm_runtime_force_suspend(ospi->dev);
962962
mutex_destroy(&ospi->lock);
963+
if (ospi->dma_chtx)
964+
dma_release_channel(ospi->dma_chtx);
965+
if (ospi->dma_chrx)
966+
dma_release_channel(ospi->dma_chrx);
963967

964968
return ret;
965969
}

0 commit comments

Comments
 (0)