From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: broonie@kernel.org
Cc: perex@perex.cz, tiwai@suse.com, srini@kernel.org,
alexey.klimov@linaro.org, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Subject: [PATCH 0/2] ASoC: qcom: sdw: fix memory leak
Date: Mon, 20 Oct 2025 14:12:06 +0100 [thread overview]
Message-ID: <20251020131208.22734-1-srinivas.kandagatla@oss.qualcomm.com> (raw)
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
next reply other threads:[~2025-10-20 13:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 13:12 Srinivas Kandagatla [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251020131208.22734-1-srinivas.kandagatla@oss.qualcomm.com \
--to=srinivas.kandagatla@oss.qualcomm.com \
--cc=alexey.klimov@linaro.org \
--cc=broonie@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=srini@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®