Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: qcom: sdw: fix memory leak
@ 2025-10-20 13:12 Srinivas Kandagatla
  2025-10-20 13:12 ` [PATCH 1/2] ASoC: qcom: sdw: fix memory leak for sdw_stream_runtime Srinivas Kandagatla
  2025-10-20 13:12 ` [PATCH 2/2] ASoC: qcom: sdw: remove redundant code Srinivas Kandagatla
  0 siblings, 2 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2025-10-20 13:12 UTC (permalink / raw)
  To: broonie
  Cc: perex, tiwai, srini, alexey.klimov, linux-sound, linux-kernel,
	linux-arm-msm, Srinivas Kandagatla

While testing for memoryleaks on T14s, it was found that the
struct sdw_stream_runtime was leaking very frequently.

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.
    

This patch series fix the issue, and while we are at it, it also remove
some redundant code from machine drivers.

Thanks,
Srini

Srinivas Kandagatla (2):
  ASoC: qcom: sdw: fix memory leak for sdw_stream_runtime
  ASoC: qcom: sdw: remove redundant code

 sound/soc/qcom/sc7280.c   |   2 +-
 sound/soc/qcom/sc8280xp.c |  33 +----------
 sound/soc/qcom/sdw.c      | 116 +++++++++++++++++++++-----------------
 sound/soc/qcom/sdw.h      |   7 +--
 sound/soc/qcom/sm8250.c   |  33 +----------
 sound/soc/qcom/x1e80100.c |  33 +----------
 6 files changed, 76 insertions(+), 148 deletions(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-20 14:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 13:12 [PATCH 0/2] ASoC: qcom: sdw: fix memory leak Srinivas Kandagatla
2025-10-20 13:12 ` [PATCH 1/2] ASoC: qcom: sdw: fix memory leak for sdw_stream_runtime Srinivas Kandagatla
2025-10-20 14:31   ` Srinivas Kandagatla
2025-10-20 13:12 ` [PATCH 2/2] ASoC: qcom: sdw: remove redundant code Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox