]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: qcom: sdw: fix memory leak
authorMark Brown <broonie@kernel.org>
Thu, 30 Oct 2025 16:07:10 +0000 (16:07 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 30 Oct 2025 16:07:10 +0000 (16:07 +0000)
commit3d8096fd378b0b4dae356e6f037d03da83f559d2
treeb4202ac6bb46bf143faa7fb3e3a88ce7dae4f5ae
parente73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0
parent8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce
ASoC: qcom: sdw: fix memory leak

Merge series from Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>:

For some reason we endedup allocating sdw_stream_runtime for every cpu dai,
this has two issues.
    1. we never set snd_soc_dai_set_stream for non soundwire dai, which
       means there is no way that we can free this, resulting in memory leak
    2. startup and shutdown callbacks can be called without
       hw_params callback called. This combination results in memory leak
    because machine driver sruntime array pointer is only set in hw_params
    callback.

All the machine drivers have these memory leaks, so cleanup the mess and
make them use common helpers from sdw.c

This patch series fix the issue, and while we are at it, it also remove
some redundant code from machine drivers.
sound/soc/fsl/fsl_micfil.c
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
sound/soc/qcom/sc8280xp.c
sound/soc/qcom/sm8250.c
sound/soc/sdw_utils/soc_sdw_utils.c