mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 14:44:10 +08:00
ASoC: topology: Add missing size check
When we parse "values" we perform check if there is correct number of them. However similar check is missing in case of "texts", add it. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20201210152541.191728-2-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
3759d5edc0
commit
f5824e5ce1
@ -856,6 +856,9 @@ static int soc_tplg_denum_create_texts(struct soc_tplg *tplg, struct soc_enum *s
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
if (le32_to_cpu(ec->items) > ARRAY_SIZE(ec->texts))
|
||||
return -EINVAL;
|
||||
|
||||
se->dobj.control.dtexts =
|
||||
devm_kcalloc(tplg->dev, le32_to_cpu(ec->items), sizeof(char *), GFP_KERNEL);
|
||||
if (se->dobj.control.dtexts == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user