linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: Use kcalloc() instead of kzalloc()
@ 2025-08-20 12:34 Qianfeng Rong
  2025-08-20 12:34 ` [PATCH 2/3] ASoC: fsl: " Qianfeng Rong
  2025-08-20 22:17 ` [PATCH 0/3] ASoC: " Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Qianfeng Rong @ 2025-08-20 12:34 UTC (permalink / raw)
  To: Nick Li, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Shengjiu Wang, Xiubo Li, Fabio Estevam, Nicolin Chen, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Kuninori Morimoto,
	Andrew Davis, Chen Ni, Linus Walleij, Qianfeng Rong, Al Viro,
	open list:FOURSEMI AUDIO AMPLIFIER DRIVER, open list,
	open list:FREESCALE SOC SOUND DRIVERS,
	open list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Replace devm_kzalloc() with devm_kcalloc() in sound/soc.  As noted in the
kernel documentation [1], open-coded multiplication in allocator arguments
is discouraged because it can lead to integer overflow.

Using devm_kcalloc() provides built-in overflow protection, making the
memory allocation safer when calculating the allocation size compared
to explicit multiplication.

[1]: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Qianfeng Rong (3):
  ASoC: codecs: Use kcalloc() instead of kzalloc()
  ASoC: fsl: Use kcalloc() instead of kzalloc()
  ASoC: test-component: Use kcalloc() instead of kzalloc()

 sound/soc/codecs/fs-amp-lib.c      | 2 +-
 sound/soc/codecs/pcm6240.c         | 4 ++--
 sound/soc/fsl/fsl_sai.c            | 2 +-
 sound/soc/fsl/imx-audmux.c         | 2 +-
 sound/soc/generic/test-component.c | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2025-08-20 22:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 12:34 [PATCH 0/3] ASoC: Use kcalloc() instead of kzalloc() Qianfeng Rong
2025-08-20 12:34 ` [PATCH 2/3] ASoC: fsl: " Qianfeng Rong
2025-08-20 22:17 ` [PATCH 0/3] ASoC: " 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).