linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc()
@ 2021-10-06 18:08 Gustavo A. R. Silva
  2021-10-07  7:13 ` Andy Shevchenko
  2022-07-28 12:48 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2021-10-06 18:08 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: alsa-devel, linux-kernel, Gustavo A. R. Silva, linux-hardening

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>
---
 sound/soc/qcom/qdsp6/q6asm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm.c b/sound/soc/qcom/qdsp6/q6asm.c
index 9251d8548965..195780f75d05 100644
--- a/sound/soc/qcom/qdsp6/q6asm.c
+++ b/sound/soc/qcom/qdsp6/q6asm.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc()
  2021-10-06 18:08 [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc() Gustavo A. R. Silva
@ 2021-10-07  7:13 ` Andy Shevchenko
  2022-07-28 12:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-10-07  7:13 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, ALSA Development Mailing List,
	Linux Kernel Mailing List, linux-hardening

On Wed, Oct 6, 2021 at 9:04 PM Gustavo A. R. Silva
<gustavoars@kernel.org> wrote:
>
> Use 2-factor multiplication argument form kcalloc() instead
> of kzalloc().

You probably need to elaborate why. E.g. refer to overflow.h and its
idea behind.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc()
  2021-10-06 18:08 [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc() Gustavo A. R. Silva
  2021-10-07  7:13 ` Andy Shevchenko
@ 2022-07-28 12:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-07-28 12:48 UTC (permalink / raw)
  To: Jaroslav Kysela, Gustavo A. R. Silva, Srinivas Kandagatla,
	Takashi Iwai, Liam Girdwood
  Cc: alsa-devel, linux-kernel, linux-hardening

On Wed, 6 Oct 2021 13:08:10 -0500, Gustavo A. R. Silva wrote:
> Use 2-factor multiplication argument form kcalloc() instead
> of kzalloc().
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: q6asm: use kcalloc() instead of kzalloc()
      commit: 40d060b8158e26438398bf1132925f666e3b6480

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-28 12:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-06 18:08 [PATCH][next] ASoC: q6asm: use kcalloc() instead of kzalloc() Gustavo A. R. Silva
2021-10-07  7:13 ` Andy Shevchenko
2022-07-28 12:48 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).