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:   Wed, 8 Jun 2022 22:48:03 +0100
From:   Vadim Fedorenko <vfedorenko@...ek.ru>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Richard Cochran <richardcochran@...il.com>
Subject: Re: [PATCH v1 net-next 5/5] ptp_ocp: replace kzalloc(x*y) by
 kcalloc(y, x)

On 08.06.2022 13:03, Andy Shevchenko wrote:
> While here it may be no difference, the kcalloc() has some checks
> against overflow and it's logically correct to call it for an array.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

Acked-by: Vadim Fedorenko <vfedorenko@...ek.ru>

> ---
>   drivers/ptp/ptp_ocp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
> index 857e35c68a04..83da36e69361 100644
> --- a/drivers/ptp/ptp_ocp.c
> +++ b/drivers/ptp/ptp_ocp.c
> @@ -2155,7 +2155,7 @@ ptp_ocp_fb_set_pins(struct ptp_ocp *bp)
>   	struct ptp_pin_desc *config;
>   	int i;
>   
> -	config = kzalloc(sizeof(*config) * 4, GFP_KERNEL);
> +	config = kcalloc(4, sizeof(*config), GFP_KERNEL);
>   	if (!config)
>   		return -ENOMEM;
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ