]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: q6asm: use kcalloc() instead of kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 6 Oct 2021 18:08:10 +0000 (13:08 -0500)
committerMark Brown <broonie@kernel.org>
Thu, 28 Jul 2022 10:59:10 +0000 (11:59 +0100)
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006180810.GA913370@embeddedor
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6asm.c

index 9251d8548965658959f46ef59ab1520928f83725..195780f75d05d2864d8f18e2ddd4636ff7494060 100644 (file)
@@ -513,7 +513,7 @@ int q6asm_map_memory_regions(unsigned int dir, struct audio_client *ac,
                return 0;
        }
 
-       buf = kzalloc(((sizeof(struct audio_buffer)) * periods), GFP_ATOMIC);
+       buf = kcalloc(periods, sizeof(*buf), GFP_ATOMIC);
        if (!buf) {
                spin_unlock_irqrestore(&ac->lock, flags);
                return -ENOMEM;