[PATCH v2 0/4] ASoC: qcom: sdw: fix memory leak

Srinivas Kandagatla posted 4 patches 3 months, 2 weeks ago
There is a newer version of this series
sound/soc/qcom/sc7280.c   |  67 +-------------------
sound/soc/qcom/sc8280xp.c |  33 +---------
sound/soc/qcom/sdm845.c   |  53 +---------------
sound/soc/qcom/sdw.c      | 127 ++++++++++++++++++++++----------------
sound/soc/qcom/sdw.h      |   7 +--
sound/soc/qcom/sm8250.c   |  33 +---------
sound/soc/qcom/x1e80100.c |  33 +---------
7 files changed, 92 insertions(+), 261 deletions(-)
[PATCH v2 0/4] ASoC: qcom: sdw: fix memory leak
Posted by Srinivas Kandagatla 3 months, 2 weeks ago
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.

Thanks,
Srini

Changes since v1:
	- added missing dais for sdm845
	- moved all the machine drivers (sdm845 and sc7280) to use
	  common helpers to avoid memory leaks.

Srinivas Kandagatla (4):
  ASoC: qcom: sdw: fix memory leak for sdw_stream_runtime
  ASoC: qcom: sdw: remove redundant code
  ASoC: qcom: sdm845: make use of common helpers
  ASoC: qcom: sc7280: make use of common helpers

 sound/soc/qcom/sc7280.c   |  67 +-------------------
 sound/soc/qcom/sc8280xp.c |  33 +---------
 sound/soc/qcom/sdm845.c   |  53 +---------------
 sound/soc/qcom/sdw.c      | 127 ++++++++++++++++++++++----------------
 sound/soc/qcom/sdw.h      |   7 +--
 sound/soc/qcom/sm8250.c   |  33 +---------
 sound/soc/qcom/x1e80100.c |  33 +---------
 7 files changed, 92 insertions(+), 261 deletions(-)

-- 
2.51.0