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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Sep 2022 10:24:54 +0200
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     cgel.zte@...il.com, broonie@...nel.org
Cc:     lgirdwood@...il.com, peter.ujfalusi@...ux.intel.com,
        yung-chuan.liao@...ux.intel.com, ranjani.sridharan@...ux.intel.com,
        kai.vehmanen@...ux.intel.com, daniel.baluta@....com,
        perex@...ex.cz, tiwai@...e.com,
        sound-open-firmware@...a-project.org, alsa-devel@...a-project.org,
        linux-kernel@...r.kernel.org, ye xingchen <ye.xingchen@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] ASOC: SOF: use devm_kcalloc() instead of
 devm_kzalloc()



On 9/16/22 08:25, cgel.zte@...il.com wrote:
> From: ye xingchen <ye.xingchen@....com.cn>
> 
> Use 2-factor multiplication argument form devm_kcalloc() instead
> of devm_kzalloc().
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: ye xingchen <ye.xingchen@....com.cn>

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>

> ---
>  sound/soc/sof/nocodec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c
> index 356497fe4f4c..3537805070ad 100644
> --- a/sound/soc/sof/nocodec.c
> +++ b/sound/soc/sof/nocodec.c
> @@ -32,7 +32,7 @@ static int sof_nocodec_bes_setup(struct device *dev,
>  
>  	/* set up BE dai_links */
>  	for (i = 0; i < link_num; i++) {
> -		dlc = devm_kzalloc(dev, 3 * sizeof(*dlc), GFP_KERNEL);
> +		dlc = devm_kcalloc(dev, 3, sizeof(*dlc), GFP_KERNEL);
>  		if (!dlc)
>  			return -ENOMEM;
>  
> @@ -78,7 +78,7 @@ static int sof_nocodec_setup(struct device *dev,
>  	struct snd_soc_dai_link *links;
>  
>  	/* create dummy BE dai_links */
> -	links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) * num_dai_drivers, GFP_KERNEL);
> +	links = devm_kcalloc(dev, num_dai_drivers, sizeof(struct snd_soc_dai_link), GFP_KERNEL);
>  	if (!links)
>  		return -ENOMEM;
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ