ASoC: Intel: sof_sdw: Add space for a terminator into DAIs array
Subsystems (3)
PATCH 1/1 ASoC: Intel: sof_sdw: Add space for a terminator into DAIs array
The code uses the initialised member of the asoc_sdw_dailink struct to determine if a member of the array is in use. However in the case the array is completely full this will lead to an access 1 past the end of the array, expand the array by one entry to include a space for a terminator.
--- sound/soc/intel/boards/sof_sdw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/soc/intel/boards/sof_sdw.c +6 -2
@@ -1072,8 +1072,12 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)return ret; } -/* One per DAI link, worst case is a DAI link for every endpoint */ - sof_dais =kcalloc (num_ends,sizeof (*sof_dais),GFP_KERNEL ); +/* +* One per DAI link, worst case is a DAI link for every endpoint, also +* add one additional to act as a terminator such that code can iterate +* until it hits an uninitialised DAI. +*/ + sof_dais =kcalloc (num_ends +1 ,sizeof (*sof_dais),GFP_KERNEL );if (!sof_dais)return -ENOMEM ;
Signature · 1 line
2.39.5
Mark Brown
maintainerQuoted 8 lines · Charles Keepax
The code uses the initialised member of the
asoc_sdw_dailinkstruct to determine if a member of the array is in use. However in the case the array is completely full this will lead to an access 1 past the end of the array, expand the array by one entry to include a space for a terminator.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: Intel: sof_sdw: Add space for a terminator into DAIs array
commit: 255cc582e6e16191a20d54bcdbca6c91d3e90c5e
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