mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
ASoC: lpass-platform: initialize dma channel number
A bugfix accidentally removed the implicit initialization of the
dma channel number, causing undefined behavior when
v->alloc_dma_channel is NULL:
sound/soc/qcom/lpass-platform.c: In function ‘lpass_platform_pcmops_open’:
sound/soc/qcom/lpass-platform.c:83:29: error: ‘dma_ch’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
This adds back an explicit initialization to zero, restoring the
previous behavior for that case.
Fixes: 022d00ee0b ("ASoC: lpass-platform: Fix broken pcm data usage")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kenneth Westfield <kwestfie@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
94201798db
commit
3b89e4b77e
|
|
@ -77,6 +77,9 @@ static int lpass_platform_pcmops_open(struct snd_pcm_substream *substream)
|
|||
|
||||
if (v->alloc_dma_channel)
|
||||
dma_ch = v->alloc_dma_channel(drvdata, dir);
|
||||
else
|
||||
dma_ch = 0;
|
||||
|
||||
if (dma_ch < 0)
|
||||
return dma_ch;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user