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:	Thu, 5 Sep 2013 05:29:16 +0100
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Dave Jones <davej@...hat.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Fix missing braces in ncpfs:ncp_lookup

On Thu, Sep 05, 2013 at 12:04:18AM -0400, Dave Jones wrote:
> Signed-off-by: Dave Jones <davej@...oraproject.org>
> 
> diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
> index 3be0474..1f6419f 100644
> --- a/fs/ncpfs/dir.c
> +++ b/fs/ncpfs/dir.c
> @@ -857,10 +857,11 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig
>  	if (ncp_is_server_root(dir)) {
>  		res = ncp_io2vol(server, __name, &len, dentry->d_name.name,
>  				 dentry->d_name.len, 1);
> -		if (!res)
> +		if (!res) {
>  			res = ncp_lookup_volume(server, __name, &(finfo.i));
>  			if (!res)
>  				ncp_update_known_namespace(server, finfo.i.volNumber, NULL);
> +		}

That, or shift two lines one indent level out ;-)  I mean,
	if (!foo)
		foo = bar();
	if (!foo)
		baz();
is provably equivalent to
	if (!foo) {
		foo = bar();
		if (!foo)
			baz();
	}

I agree that the current form shouldn't be left as-is - the kernel isn't
IOCCC and all such.  The only question is which variant would read better...
--
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