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 <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent 17955ab commit 051d71e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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)