Unverified Commit 543466ef authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

ASoC: topology: Fix memory corruption in soc_tplg_denum_create_values()



The allocation uses sizeof(u32) when it should use sizeof(unsigned long)
so it leads to memory corruption later in the function when the data is
initialized.

Fixes: 5aebe7c7 ("ASoC: topology: fix endianness issues")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YAf+8QZoOv+ct526@mwanda


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1e066a23
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -902,7 +902,7 @@ static int soc_tplg_denum_create_values(struct soc_tplg *tplg, struct soc_enum *
		return -EINVAL;

	se->dobj.control.dvalues = devm_kcalloc(tplg->dev, le32_to_cpu(ec->items),
					   sizeof(u32),
					   sizeof(*se->dobj.control.dvalues),
					   GFP_KERNEL);
	if (!se->dobj.control.dvalues)
		return -ENOMEM;