未验证 提交 f5824e5c 编写于 作者: A Amadeusz Sławiński 提交者: Mark Brown

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: NAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: NRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20201210152541.191728-2-amadeuszx.slawinski@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 3759d5ed
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册