lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250824135521.590780-2-rongqianfeng@vivo.com>
Date: Sun, 24 Aug 2025 21:55:10 +0800
From: Qianfeng Rong <rongqianfeng@...o.com>
To: Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Qianfeng Rong <rongqianfeng@...o.com>,
	linux-sound@...r.kernel.org (open list:SOUND),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 1/3] ALSA: cs46xx: use vmalloc_array() to simplify code

Remove array_size() calls and replace vmalloc() with vmalloc_array() in
cs46xx_dsp_spos_create() to simplify the code and maintain consistency
with existing kmalloc_array() usage.

Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
---
 sound/pci/cs46xx/dsp_spos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index e07f85322f1c..0aa68f9dd2aa 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -228,8 +228,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
 
 	/* better to use vmalloc for this big table */
 	ins->symbol_table.symbols =
-		vmalloc(array_size(DSP_MAX_SYMBOLS,
-				   sizeof(struct dsp_symbol_entry)));
+		vmalloc_array(DSP_MAX_SYMBOLS,
+			      sizeof(struct dsp_symbol_entry));
 	ins->code.data = kmalloc(DSP_CODE_BYTE_SIZE, GFP_KERNEL);
 	ins->modules = kmalloc_array(DSP_MAX_MODULES,
 				     sizeof(struct dsp_module_desc),
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ