Commit f047199e authored by ye xingchen's avatar ye xingchen Committed by Mark Brown

ASoC: amd: acp: use function devm_kcalloc() instead of devm_kzalloc()

Use 2-factor multiplication argument form devm_kcalloc() instead
of devm_kzalloc().
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220916062027.152815-1-ye.xingchen@zte.com.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 09dea5ac
...@@ -584,7 +584,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card) ...@@ -584,7 +584,7 @@ int acp_sofdsp_dai_links_create(struct snd_soc_card *card)
if (drv_data->dmic_cpu_id) if (drv_data->dmic_cpu_id)
num_links++; num_links++;
links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_links, GFP_KERNEL); links = devm_kcalloc(dev, num_links, sizeof(struct snd_soc_dai_link), GFP_KERNEL);
if (!links) if (!links)
return -ENOMEM; return -ENOMEM;
...@@ -749,7 +749,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card) ...@@ -749,7 +749,7 @@ int acp_legacy_dai_links_create(struct snd_soc_card *card)
if (drv_data->dmic_cpu_id) if (drv_data->dmic_cpu_id)
num_links++; num_links++;
links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_links, GFP_KERNEL); links = devm_kcalloc(dev, num_links, sizeof(struct snd_soc_dai_link), GFP_KERNEL);
if (!links) if (!links)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment