Commit 40d060b8 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Mark Brown

ASoC: q6asm: use kcalloc() instead of kzalloc()

Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006180810.GA913370@embeddedorSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b0115612
...@@ -513,7 +513,7 @@ int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac, ...@@ -513,7 +513,7 @@ int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac,
return 0; return 0;
} }
buf = kzalloc(((sizeof(struct audio_buffer)) * periods), GFP_ATOMIC); buf = kcalloc(periods, sizeof(*buf), GFP_ATOMIC);
if (!buf) { if (!buf) {
spin_unlock_irqrestore(&ac->lock, flags); spin_unlock_irqrestore(&ac->lock, flags);
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