diff options
author | V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com> | 2023-05-08 12:35:08 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-09 14:43:33 +0900 |
commit | 051d71e073614a72ad423d6dacba37a7eeff274d (patch) | |
tree | fe912fbdca42d3d636522a9cc86218cb6c19b97b | |
parent | 17955aba7877a4494d8093ae5498e19469b01d57 (diff) | |
download | linux-stable-051d71e073614a72ad423d6dacba37a7eeff274d.tar.gz linux-stable-051d71e073614a72ad423d6dacba37a7eeff274d.tar.bz2 linux-stable-051d71e073614a72ad423d6dacba37a7eeff274d.zip |
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
-rw-r--r-- | sound/soc/sof/amd/acp-ipc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/sof/amd/acp-ipc.c b/sound/soc/sof/amd/acp-ipc.c index 4e0c48a36159..749e856dc601 100644 --- a/sound/soc/sof/amd/acp-ipc.c +++ b/sound/soc/sof/amd/acp-ipc.c @@ -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; |