ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function
Subsystems (3)
PATCH 1/1 ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function
Check substream and runtime variables before assigning.
Signed-off-by V sujith kumar Reddy <[email protected]>
--- sound/soc/sof/amd/acp-ipc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
sound/soc/sof/amd/acp-ipc.c +6 -1
@@ -209,7 +209,12 @@ int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *spacp_mailbox_read (sdev, offset, p, sz); }else {struct snd_pcm_substream *substream = sps->substream; -struct acp_dsp_stream *stream = substream->runtime->private_data; +struct acp_dsp_stream *stream; + +if (!substream || !substream->runtime) +return -ESTRPIPE ; + + stream = substream->runtime->private_data;if (!stream)return -ESTRPIPE ;
Signature · 1 line
2.25.1