Thread (6 messages) 6 messages, 2 authors, 2020-07-24

Re: [PATCH] keys: asymmetric: fix error return code in software_key_query()

From: David Howells <dhowells@redhat.com>
Date: 2020-07-23 07:31:35
Also in: keyrings, lkml

Jarkko Sakkinen [off-list ref] wrote:
quoted
 	if (IS_ERR(tfm))
 		return PTR_ERR(tfm);
 
+	ret = -ENOMEM;
This is extremely confusing to read way to handle 'ret'.

Would be way more cleaner to be just simple and stupid:

	if (!key) {
		ret = -ENOMEM;
		goto error_free_tfm;
	}
I agree, but we have some people who will (or who used to) moan at you for
doing in four lines what you could've done in three.  I don't know if this is
still the standard.

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help