mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-14 21:29:37 +02: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();
|
const struct mbus_dram_target_info *dram = mv_mbus_dram_info();
|
||||||
unsigned long addr = substream->runtime->dma_addr;
|
unsigned long addr = substream->runtime->dma_addr;
|
||||||
|
|
||||||
|
if (!dram)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||||
kirkwood_dma_conf_mbus_windows(priv->io,
|
kirkwood_dma_conf_mbus_windows(priv->io,
|
||||||
KIRKWOOD_PLAYBACK_WIN, addr, dram);
|
KIRKWOOD_PLAYBACK_WIN, addr, dram);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user