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, 27 Jul 2016 10:09:04 +0200
From:	Oliver Neukum <oneukum@...e.com>
To:	Mathieu OTHACEHE <m.othacehe@...il.com>
Cc:	johan@...nel.org, gregkh@...uxfoundation.org,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc
 instead of kmalloc

On Tue, 2016-07-26 at 19:59 +0200, Mathieu OTHACEHE wrote:
> Use kzalloc instead of kmalloc to avoid field initialisation to 0.
> 
> Signed-off-by: Mathieu OTHACEHE <m.othacehe@...il.com>
> ---
>  drivers/usb/serial/ti_usb_3410_5052.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
> index 50a74b3..b694d69 100644
> --- a/drivers/usb/serial/ti_usb_3410_5052.c
> +++ b/drivers/usb/serial/ti_usb_3410_5052.c
> @@ -969,7 +969,7 @@ static void ti_set_termios(struct tty_struct *tty,
>  	if (tport == NULL)
>  		return;
>  
> -	config = kmalloc(sizeof(*config), GFP_KERNEL);
> +	config = kzalloc(sizeof(*config), GFP_KERNEL);
>  	if (!config)
>  		return;
>  

Hi,

in that case, where is the initialisation to 0 you avoid and hence
can remove from the code?

	Regards
		Oliver


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ