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:	Tue, 10 Feb 2015 13:10:23 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Quentin Lambert <lambert.quentin@...il.com>
Cc:	Shigekatsu Tateno <shigekatsu.tateno@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] staging: ozwpan: Remove allocation from delaration
 line

On Tue, Feb 10, 2015 at 09:55:03AM +0100, Quentin Lambert wrote:
>  static struct oz_endpoint *oz_ep_alloc(int buffer_size, gfp_t mem_flags)
>  {
> -	struct oz_endpoint *ep =
> -		kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags);
> +	struct oz_endpoint *ep;
> +
> +	ep = kzalloc(sizeof(struct oz_endpoint)+buffer_size, mem_flags);
> +
>  	if (ep) {

Don't put a blank line between the function and the test.  They are part
of the same thing.

Also in a later patch, could you reverse the "if (ep) " to

	if (!ep)
		return NULL;

The original code is "success handling" not "error handling".

regards,
dan carpenter

--
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