Skip to content

Commit 051d71e

Browse files
reddysujithbroonie
authored andcommitted
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 <Vsujithkumar.Reddy@amd.com Link: https://lore.kernel.org/r/20230508070510.6100-1-Vsujithkumar.Reddy@amd.com Signed-off-by: Mark Brown <broonie@kernel.org
1 parent 17955ab commit 051d71e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sound/soc/sof/amd/acp-ipc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,12 @@ int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *sp
209209
acp_mailbox_read(sdev, offset, p, sz);
210210
} else {
211211
struct snd_pcm_substream *substream = sps->substream;
212-
struct acp_dsp_stream *stream = substream->runtime->private_data;
212+
struct acp_dsp_stream *stream;
213+
214+
if (!substream || !substream->runtime)
215+
return -ESTRPIPE;
216+
217+
stream = substream->runtime->private_data;
213218

214219
if (!stream)
215220
return -ESTRPIPE;

0 commit comments

Comments
 (0)