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]
Message-Id: <20141104.150701.1883825026786055864.davem@davemloft.net>
Date:	Tue, 04 Nov 2014 15:07:01 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	joe@...ches.com
Cc:	fabf@...net.be, linux-kernel@...r.kernel.org,
	steffen.klassert@...unet.com, herbert@...dor.apana.org.au,
	kuznet@....inr.ac.ru, jmorris@...ei.org, yoshfuji@...ux-ipv6.org,
	kaber@...sh.net, netdev@...r.kernel.org
Subject: Re: [PATCH 1/1 net-next] esp4: remove assignment in if condition

From: Joe Perches <joe@...ches.com>
Date: Tue, 04 Nov 2014 11:33:51 -0800

> On Tue, 2014-11-04 at 20:28 +0100, Fabian Frederick wrote:
> 
> trivia:
> 
>> diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c
> []
>> @@ -392,8 +392,11 @@ static int esp_input(struct xfrm_state *x, struct sk_buff *skb)
>>  	if (elen <= 0)
>>  		goto out;
>>  
>> -	if ((err = skb_cow_data(skb, 0, &trailer)) < 0)
>> +	err = skb_cow_data(skb, 0, &trailer);
>> +
>> +	if (err < 0)
>>  		goto out;
> 
> Generally it's better/more common to use
> 
> 	foo = bar();
> 	if (!foo)
> 		[error_handler...]
> 	
> without the blank line between the set
> and the test.

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