Commit 7b88552c authored by ye xingchen's avatar ye xingchen Committed by Mark Brown

ASOC: SOF: use 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>
Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220916062511.153962-1-ye.xingchen@zte.com.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b60200d7
......@@ -32,7 +32,7 @@ static int sof_nocodec_bes_setup(struct device *dev,
/* set up BE dai_links */
for (i = 0; i < link_num; i++) {
dlc = devm_kzalloc(dev, 3 * sizeof(*dlc), GFP_KERNEL);
dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL);
if (!dlc)
return -ENOMEM;
......@@ -78,7 +78,7 @@ static int sof_nocodec_setup(struct device *dev,
struct snd_soc_dai_link *links;
/* create dummy BE dai_links */
links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL);
links = devm_kcalloc(dev, num_dai_drivers, sizeof(struct snd_soc_dai_link), GFP_KERNEL);
if (!links)
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