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] [day] [month] [year] [list]
Date:   Sun, 18 Dec 2022 16:50:23 +0100
From:   Martin Kaiser <lists@...ser.cx>
To:     Kang Minchul <tegongkang@...il.com>
Cc:     Larry Finger <Larry.Finger@...inger.net>,
        Phillip Potter <phil@...lpotter.co.uk>,
        Pavel Skripkin <paskripkin@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: r8188eu: Prefer kcalloc over kzalloc

Thus wrote Kang Minchul (tegongkang@...il.com):

> Fixed following checkpatch.pl warning:
>  * WARNING: Prefer kcalloc over kzalloc with multiply

> Instead of specifying (number of bytes) * (size) as arugment
> in kzalloc, prefer kcalloc.

> Signed-off-by: Kang Minchul <tegongkang@...il.com>
> ---
>  drivers/staging/r8188eu/core/rtw_xmit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c
> index 34494f08c0cd..36ce1e3f9c81 100644
> --- a/drivers/staging/r8188eu/core/rtw_xmit.c
> +++ b/drivers/staging/r8188eu/core/rtw_xmit.c
> @@ -1564,7 +1564,7 @@ int rtw_alloc_hwxmits(struct adapter *padapter)

>  	pxmitpriv->hwxmit_entry = HWXMIT_ENTRY;

> -	pxmitpriv->hwxmits = kzalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry, GFP_KERNEL);
> +	pxmitpriv->hwxmits = kcalloc(pxmitpriv->hwxmit_entry, sizeof(struct hw_xmit), GFP_KERNEL);
>  	if (!pxmitpriv->hwxmits)
>  		return -ENOMEM;

> -- 
> 2.34.1

Reviewed-by: Martin Kaiser <martin@...ser.cx>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ