ASoC: core: fix wrong size kzalloc for rtd's components member

The actual space for struct snd_soc_component has been allocated by
snd_soc_register_component, here rtd's components are pointers to
components, I replace the base size from *component to component.

Signed-off-by: lishqchn <lishqchn@qq.com>
Link: https://lore.kernel.org/r/tencent_59850BB028662B6F2D49D7F3624AB84CCF05@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
lishqchn 2022-11-08 12:24:56 +08:00 committed by Mark Brown
parent 710ccba0cf
commit 66a796c04b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -447,7 +447,7 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
*/
rtd = devm_kzalloc(dev,
sizeof(*rtd) +
sizeof(*component) * (dai_link->num_cpus +
sizeof(component) * (dai_link->num_cpus +
dai_link->num_codecs +
dai_link->num_platforms),
GFP_KERNEL);