Unverified Commit 460b14b0 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Mark Brown
Browse files

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: 79b8a705 ("spi: stm32: Add OSPI driver")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarPatrice Chotard <patrice.chotard@foss.st.com>
Link: https://patch.msgid.link/2674c8df1d05ab312826b69bfe9559f81d125a0b.1744975624.git.christophe.jaillet@wanadoo.fr


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8ffd015d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -960,6 +960,10 @@ static int stm32_ospi_probe(struct platform_device *pdev)
err_pm_enable:
	pm_runtime_force_suspend(ospi->dev);
	mutex_destroy(&ospi->lock);
	if (ospi->dma_chtx)
		dma_release_channel(ospi->dma_chtx);
	if (ospi->dma_chrx)
		dma_release_channel(ospi->dma_chrx);

	return ret;
}