Skip to content

Commit b97493f

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 5bd67f5 commit b97493f

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
@@ -181,7 +181,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s
181181
* It is recommend to load DSP with source graph first and then sink
182182
* graph, so sequence for playback and capture will be different
183183
*/
184-
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
184+
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && dai_data->graph[dai->id] == NULL) {
185185
graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id);
186186
if (IS_ERR(graph)) {
187187
dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id);

0 commit comments

Comments
 (0)