Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: stm32: fix rx DMA request error handling

Avoid trying to release the RX DMA channel when an error occurs
during RX dma_request_chan() call. Instead, jump directly to
release the TX channel, if applicable.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-spi/aYXvY6NH7OlZ-OAF@stanley.mountain/T/#u
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://patch.msgid.link/20260212-spi-stm32-fix-dma-rx-release-v1-1-53a37c31626b@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Alain Volmat and committed by
Mark Brown
837f6691 20a88c15

+4 -4
+4 -4
drivers/spi/spi-stm32.c
··· 2502 2502 spi->dma_rx = NULL; 2503 2503 } else { 2504 2504 dev_err_probe(&pdev->dev, ret, "failed to request rx dma channel\n"); 2505 - goto err_dma_release; 2505 + goto err_dma_tx_release; 2506 2506 } 2507 2507 } else { 2508 2508 ctrl->dma_rx = spi->dma_rx; ··· 2571 2571 if (spi->sram_pool) 2572 2572 gen_pool_free(spi->sram_pool, (unsigned long)spi->sram_rx_buf, 2573 2573 spi->sram_rx_buf_size); 2574 - err_dma_release: 2575 - if (spi->dma_tx) 2576 - dma_release_channel(spi->dma_tx); 2577 2574 if (spi->dma_rx) 2578 2575 dma_release_channel(spi->dma_rx); 2576 + err_dma_tx_release: 2577 + if (spi->dma_tx) 2578 + dma_release_channel(spi->dma_tx); 2579 2579 err_clk_disable: 2580 2580 clk_disable_unprepare(spi->clk); 2581 2581