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]
Date:	Tue, 18 Mar 2014 13:17:25 -0700
From:	Joe Perches <joe@...ches.com>
To:	Silvio F <silvio.fricke@...il.com>
Cc:	linux-kernel@...r.kernel.org, daeseok.youn@...il.com,
	silvio@...t1024.net
Subject: Re: [PATCH] staging: unisys: kmalloc/memset to kzalloc conversation

On Tue, 2014-03-18 at 21:07 +0100, Silvio F wrote:
> This patch solves the Coccinelle warning: "kzalloc should be used
> instead of kmalloc/memset"
[]
> diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h
[]
> @@ -190,10 +190,7 @@ struct chaninfo {
>  }
>  
>  #define ALLOC_CMDRSP(cmdrsp) { \
> -	cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC); \
> -	if (cmdrsp != NULL) { \
> -		memset(cmdrsp, 0, SIZEOF_CMDRSP); \
> -	} \
> +	cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC); \
>  }

It'd be nicer to get rid of this macro altogether
and substitute kzalloc in the 3 places it's used.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ