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

Srinivas Kandagatla posted 2 patches 3 months, 2 weeks ago
There is a newer version of this series
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(-)
[PATCH 0/2] ASoC: qcom: sdw: fix memory leak
Posted by Srinivas Kandagatla 3 months, 2 weeks ago
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