ASoC: soc-generic-dmaengine-pcm: separate max_buffer_size assignment
Subsystems (3)
PATCH 1/1 ASoC: soc-generic-dmaengine-pcm: separate max_buffer_size assignment
The config->pcm_hardware may be NULL when config->prealloc_buffer_size is not zero, so it is better to move max_buffer_size assignment under a separate condition.
--- sound/soc/soc-generic-dmaengine-pcm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
sound/soc/soc-generic-dmaengine-pcm.c +6 -4
@@ -237,13 +237,15 @@ static int dmaengine_pcm_new(struct snd_soc_component *component,size_t max_buffer_size;unsigned int i; -if (config && config->prealloc_buffer_size) { +if (config && config->prealloc_buffer_size) prealloc_buffer_size = config->prealloc_buffer_size; - max_buffer_size = config->pcm_hardware->buffer_bytes_max; - }else { +else prealloc_buffer_size = prealloc_buffer_size_kbytes *1024 ; + +if (config && config->pcm_hardware && config->pcm_hardware->buffer_bytes_max) + max_buffer_size = config->pcm_hardware->buffer_bytes_max; +else max_buffer_size =SIZE_MAX ; - }for_each_pcm_streams (i) {struct snd_pcm_substream *substream = rtd->pcm->streams[i].substream;
Signature · 1 line
2.17.1
Mark Brown
maintainerQuoted 5 lines · Shengjiu Wang
The
config->pcm_hardwaremay be NULL whenconfig->prealloc_buffer_sizeis not zero, so it is better to movemax_buffer_sizeassignment under a separate condition.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: soc-generic-dmaengine-pcm: separate max_buffer_size assignment
commit: 88c62b16281e5fe748f22f44da3def8a91fb1c34
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