Unverified Commit 051d71e0 authored by V sujith kumar Reddy's avatar V sujith kumar Reddy Committed by Mark Brown
Browse files

ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function



Check substream and runtime variables before assigning.

Signed-off-by: default avatarV sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Link: https://lore.kernel.org/r/20230508070510.6100-1-Vsujithkumar.Reddy@amd.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 17955aba
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -209,7 +209,12 @@ int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *sp
		acp_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;