ASoC: lpass-platform: initialize dma channel number
Subsystems (3)
PATCH 1/1 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.
--- sound/soc/qcom/lpass-platform.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/qcom/lpass-platform.c +3 -0
@@ -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;
Signature · 1 line
2.9.0
Quoted 7 lines · Arnd Bergmann
A bugfix accidentally removed the implicit initialization of the dma channel number, causing undefined behavior when
v->alloc_dma_channelis 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]
Quoted 8 lines
This adds back an explicit initialization to zero, restoring the previous behavior for that case.
Fixes 022d00ee0b55 ("ASoC: lpass-platform: Fix broken pcm data usage")Signed-off-by Arnd Bergmann <[email protected]>--- sound/soc/qcom/lpass-platform.c | 3 +++ 1 file changed, 3 insertions(+)
Good catch.
Signature · 4 lines
Kenneth Westfield Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Mark Brown
maintainerApplied "ASoC: lpass-platform: initialize dma channel number" to the asoc tree
In reply to Arnd BergmannThe patch
ASoC: lpass-platform: initialize dma channel number
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
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
Quoted 1 line
From
3b89e4b77ef9c2f985964fab17032db98f074ed0Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Tue, 8 Nov 2016 14:38:52 +0100
Subject: [PATCH] ASoC: lpass-platform: initialize dma channel number
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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.
--- sound/soc/qcom/lpass-platform.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/qcom/lpass-platform.c +3 -0
@@ -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;
Signature · 1 line
2.10.2