spi: stm32: fix sram pool free in probe error path
authorClément Le Goffic <clement.legoffic@foss.st.com>
Mon, 30 Jun 2025 12:59:23 +0000 (14:59 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 30 Jun 2025 14:59:47 +0000 (15:59 +0100)
commitf4d8438e6a402ad40cf4ccb6e2d2417d9ed47821
tree4aabb616a12d06df1a69b6ef64d33b34ab6df2bf
parent7e1c28fbf235791cb5046fafdac5bc16fe8e788d
spi: stm32: fix sram pool free in probe error path

Add a test to check whether the sram_pool is NULL before freeing it.

Fixes: d17dd2f1d8a1 ("spi: stm32: use STM32 DMA with STM32 MDMA to enhance DDR use")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Link: https://patch.msgid.link/20250630-spi-fix-v2-1-4680939e2a3e@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32.c