mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function
@ 2023-05-08  7:05 V sujith kumar Reddy
  2023-05-09  9:32 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: V sujith kumar Reddy @ 2023-05-08  7:05 UTC (permalink / raw)
  To: broonie, alsa-devel
  Cc: Vijendar.Mukunda, Basavaraj.Hiregoudar, Sunil-kumar.Dommati,
	venkataprasad.potturu, ssabakar, V sujith kumar Reddy,
	Pierre-Louis Bossart, Liam Girdwood, Peter Ujfalusi, Bard Liao,
	Ranjani Sridharan, Kai Vehmanen, Daniel Baluta, Jaroslav Kysela,
	Takashi Iwai, Paul Olaru, Ajit Kumar Pandey,
	moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS,
	open list

Check substream and runtime variables before assigning.

Signed-off-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
---
 sound/soc/sof/amd/acp-ipc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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;
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-09  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-08  7:05 [PATCH] ASoC: SOF: amd: Fix NULL pointer crash in acp_sof_ipc_msg_data function V sujith kumar Reddy
2023-05-09  9:32 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®