linux-stable/sound/soc/stm
Amelie Delaunay 4f1d74f747 ASoC: stm32: spdifrx: fix dma channel release in stm32_spdifrx_remove
[ Upstream commit 9bb4af400c ]

In case of error when requesting ctrl_chan DMA channel, ctrl_chan is not
null. So the release of the dma channel leads to the following issue:
[    4.879000] st,stm32-spdifrx 500d0000.audio-controller:
dma_request_slave_channel error -19
[    4.888975] Unable to handle kernel NULL pointer dereference
at virtual address 000000000000003d
[...]
[    5.096577] Call trace:
[    5.099099]  dma_release_channel+0x24/0x100
[    5.103235]  stm32_spdifrx_remove+0x24/0x60 [snd_soc_stm32_spdifrx]
[    5.109494]  stm32_spdifrx_probe+0x320/0x4c4 [snd_soc_stm32_spdifrx]

To avoid this issue, release channel only if the pointer is valid.

Fixes: 794df9448e ("ASoC: stm32: spdifrx: manage rebind issue")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Signed-off-by: Olivier Moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20241105140242.527279-1-olivier.moysan@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-14 13:15:13 +01:00
..
Kconfig ASoC: stm: depend on COMMON_CLK to fix compile tests 2020-11-23 20:39:48 +00:00
Makefile ASoC: stm32: add DFSDM DAI support 2018-01-10 10:52:05 +00:00
stm32_adfsdm.c ASoC: stm32: dfsdm: manage cb buffers cleanup 2022-11-09 17:56:37 +00:00
stm32_i2s.c ASoC: stm32: i2s: remove irqf_oneshot flag 2022-11-10 17:50:52 +00:00
stm32_sai_sub.c ASoC: stm32: Migrate to new style legacy DAI naming flag 2022-06-27 13:16:20 +01:00
stm32_sai.c ASoC: stm: Use dev_err_probe() helper 2021-12-20 12:47:23 +00:00
stm32_sai.h Linux 5.2-rc6 2019-06-26 12:39:34 +01:00
stm32_spdifrx.c ASoC: stm32: spdifrx: fix dma channel release in stm32_spdifrx_remove 2024-11-14 13:15:13 +01:00