Skip to content

Commit 3141d8b

Browse files
Srinivas Kandagatlagregkh
authored andcommitted
ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens
commit 69acc48 upstream. As prepare can be called mulitple times, this can result in multiple graph opens for playback path. This will result in a memory leaks, fix this by adding a check before opening. Fixes: be1fae6 ("ASoC: q6apm-lpass-dai: close graph on prepare errors") Cc: Stable@vger.kernel.org Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260402081118.348071-5-srinivas.kandagatla@oss.qualcomm.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cb25b46 commit 3141d8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/qcom/qdsp6/q6apm-lpass-dais.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s
175175
* It is recommend to load DSP with source graph first and then sink
176176
* graph, so sequence for playback and capture will be different
177177
*/
178-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
178+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && dai_data->graph[dai->id] == NULL) {
179179
graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id);
180180
if (IS_ERR(graph)) {
181181
dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id);

0 commit comments

Comments
 (0)