lkml.org 
[lkml]   [2020]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] keys: asymmetric: fix error return code in software_key_query()
Date
Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> wrote:

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

\
 
 \ /
  Last update: 2020-07-23 09:31    [W:0.042 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site