diff mbox series

[2/2] ASoC: SOF: pcm: Clear the susbstream pointer to NULL on close

Message ID 20241213131318.19481-3-peter.ujfalusi@linux.intel.com (mailing list archive)
State New
Headers show
Series ASoC: SOF: Correct sps->stream and cstream nullity management | expand

Commit Message

Peter Ujfalusi Dec. 13, 2024, 1:13 p.m. UTC
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: ef8ba9f79953 ("ASoC: SOF: Add support for compress API for stream data/offset")
Cc: stable@vger.kernel.org
Reported-by: Curtis Malainey <cujomalainey@chromium.org>
Closes: https://github.com/thesofproject/linux/pull/5214
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Curtis Malainey <cujomalainey@chromium.org>
---
 sound/soc/sof/pcm.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mark Brown Dec. 16, 2024, 12:30 p.m. UTC | #1
On Fri, Dec 13, 2024 at 03:13:18PM +0200, Peter Ujfalusi wrote:

> Fixes: ef8ba9f79953 ("ASoC: SOF: Add support for compress API for stream data/offset")
> Cc: stable@vger.kernel.org

This commit doesn't exist.
diff mbox series

Patch

diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index 35a7462d8b69..c5c6353f18ce 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -511,6 +511,8 @@  static int sof_pcm_close(struct snd_soc_component *component,
 		 */
 	}
 
+	spcm->stream[substream->stream].substream = NULL;
+
 	return 0;
 }