mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
ASoC: topology: Fix memory corruption in soc_tplg_denum_create_values()
commit543466ef35upstream. 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:5aebe7c7f9("ASoC: topology: fix endianness issues") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/YAf+8QZoOv+ct526@mwanda Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
4a97f42a66
commit
1e3a8d94dd
@@ -987,7 +987,7 @@ static int soc_tplg_denum_create_values(struct soc_enum *se,
|
||||
return -EINVAL;
|
||||
|
||||
se->dobj.control.dvalues = kzalloc(le32_to_cpu(ec->items) *
|
||||
sizeof(u32),
|
||||
sizeof(*se->dobj.control.dvalues),
|
||||
GFP_KERNEL);
|
||||
if (!se->dobj.control.dvalues)
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user