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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 06 Dec 2017 14:50:17 +0000
From:   David Howells <dhowells@...hat.com>
To:     James Morris <james.l.morris@...cle.com>
Cc:     dhowells@...hat.com, Colin King <colin.king@...onical.com>,
        "Serge E . Hallyn" <serge@...lyn.com>, keyrings@...r.kernel.org,
        linux-security-module@...r.kernel.org,
        kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] security: keys: remove redundant assignment to key_ref

James Morris <james.l.morris@...cle.com> wrote:

> I think a general cleanup in that function to make all of these follow the 
> pattern:
> 
> 	if (something) {
> 		key_ref = ERR_PTR(-error);
> 		goto error;
> 	}
> 
> rather than unconditionally setting the error first, would be better, but 
> this is a clear enough fix on its own.

There's a preference in Linux to use:

	key_ref = ERR_PTR(-error);
 	if (something)
 		goto error;

instead because it uses less vertical space.  It might originally have been
promulgated by Linus, but I don't remember.  Though you do have a point - your
way makes error handling less subject breakage from code rearrangement.

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ