Commit 868d81f7 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Wentao Guan
Browse files

ASoC: SOF: pcm: Clear the susbstream pointer to NULL on close

stable inclusion
from stable-v6.6.80
commit f69d2cd846001d2957671c950ffd75a86911eacb
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBXANC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f69d2cd846001d2957671c950ffd75a86911eacb



--------------------------------

commit 46c7b901e2a03536df5a3cb40b3b26e2be505df6 upstream.

The spcm->stream[substream->stream].substream is set during open and was
left untouched. After the first PCM stream it will never be NULL and we
have code which checks for substream NULLity as indication if the stream is
active or not.
For the compressed cstream pointer the same has been done, this change will
correct the handling of PCM streams.

Fixes: 090349a9 ("ASoC: SOF: Add support for compress API for stream data/offset")
Cc: stable@vger.kernel.org
Reported-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
Closes: https://github.com/thesofproject/linux/pull/5214


Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
Link: https://patch.msgid.link/20250205135232.19762-3-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f69d2cd846001d2957671c950ffd75a86911eacb)
Signed-off-by: default avatarWentao Guan <guanwentao@uniontech.com>
parent 80454c35
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -507,6 +507,8 @@ static int sof_pcm_close(struct snd_soc_component *component,
		 */
	}

	spcm->stream[substream->stream].substream = NULL;

	return 0;
}