Skip to contentSkip to conversation

ASoC: SOF: ipc4-pcm: fix possible null pointer deference

PATCH In review Peter Ujfalusi 2 participants 2 messages Aug 16, 2023

Subsystems (3)
lore
Share & tools
lore

Peter Ujfalusi

author maintainer
#0 lore raw

PATCH 1/1 ASoC: SOF: ipc4-pcm: fix possible null pointer deference

From: Chao Song <[email protected]>

The call to snd_sof_find_spcm_dai() could return NULL, add nullable check for the return value to avoid null pointer defenrece.

Fixes 7cb19007baba ("ASoC: SOF: ipc4-pcm: add hw_params")
---
 sound/soc/sof/ipc4-pcm.c | 3 +++
 1 file changed, 3 insertions(+)
sound/soc/sof/ipc4-pcm.c +3 -0
index 802cbf73594e..db19cd03ecad 100644
@@ -709,6 +709,9 @@ static int sof_ipc4_pcm_hw_params(struct snd_soc_component *component,
 	struct snd_sof_pcm *spcm;
 
 	spcm = snd_sof_find_spcm_dai(component, rtd);
+	if (!spcm)
+		return -EINVAL;
+
 	time_info = spcm->stream[substream->stream].private;
 	/* delay calculation is not supported by current fw_reg ABI */
 	if (!time_info)
Signature · 1 line
2.41.0
maintainer
#1 lore raw
Quoted 5 lines · Peter Ujfalusi

The call to snd_sof_find_spcm_dai() could return NULL, add nullable check for the return value to avoid null pointer defenrece.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: SOF: ipc4-pcm: fix possible null pointer deference

      commit: 2d218b45848b92b03b220bf4d9bef29f058f866f

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark