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:   Fri, 25 Nov 2016 15:17:37 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     James Simmons <jsimmons@...radead.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org,
        Andreas Dilger <andreas.dilger@...el.com>,
        Oleg Drokin <oleg.drokin@...el.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lustre Development List <lustre-devel@...ts.lustre.org>
Subject: Re: [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons
 in headers

On Fri, Nov 18, 2016 at 11:48:42AM -0500, James Simmons wrote:
> diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> index 93bff1b..fc180b8 100644
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h
> @@ -96,7 +96,7 @@
>  
>  #define LIBCFS_ALLOC_POST(ptr, size)					    \
>  do {									    \
> -	if (unlikely((ptr) == NULL)) {					    \
> +	if (!unlikely((ptr))) {						    \

Argh....  No.  You did this with a Perl script?

This should be:

	if (unlikely(!ptr)) { ...

>  		CERROR("LNET: out of memory at %s:%d (tried to alloc '"	    \
>  		       #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size));  \
>  	} else {							    \
> @@ -147,7 +147,7 @@
>  
>  #define LIBCFS_FREE(ptr, size)					  \
>  do {								    \
> -	if (unlikely((ptr) == NULL)) {				  \
> +	if (!unlikely((ptr))) {						\

Same.

Otherwise the unlikely hint is reversed from what we want.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ