mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
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
This commit is contained in:
parent
17955aba78
commit
051d71e073
1 changed files with 6 additions and 1 deletions
|
@ -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);
|
acp_mailbox_read(sdev, offset, p, sz);
|
||||||
} else {
|
} else {
|
||||||
struct snd_pcm_substream *substream = sps->substream;
|
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)
|
if (!stream)
|
||||||
return -ESTRPIPE;
|
return -ESTRPIPE;
|
||||||
|
|
Loading…
Reference in a new issue