mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
ASoC: kirkwood: Fix potential NULL dereference
[ Upstream commitea60ab9572
] In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if CONFIG_PLAT_ORION macro is not defined. Fix this bug by adding NULL check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes:bb6a40fc5a
("ASoC: kirkwood: Fix reference to PCM buffer address") Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru> Link: https://msgid.link/r/20240328173337.21406-1-amishin@t-argos.ru Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4a1dc97212
commit
1a7254525c
@ -182,6 +182,9 @@ static int kirkwood_dma_hw_params(struct snd_soc_component *component,
|
||||
const struct mbus_dram_target_info *dram = mv_mbus_dram_info();
|
||||
unsigned long addr = substream->runtime->dma_addr;
|
||||
|
||||
if (!dram)
|
||||
return 0;
|
||||
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
kirkwood_dma_conf_mbus_windows(priv->io,
|
||||
KIRKWOOD_PLAYBACK_WIN, addr, dram);
|
||||
|
Loading…
Reference in New Issue
Block a user