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: <YtTYexaeIWZgSwfH@google.com>
Date:   Mon, 18 Jul 2022 03:50:19 +0000
From:   Tzung-Bi Shih <tzungbi@...nel.org>
To:     Guenter Roeck <groeck@...gle.com>
Cc:     Benson Leung <bleung@...omium.org>,
        Guenter Roeck <groeck@...omium.org>,
        "open list:CHROME HARDWARE PLATFORM SUPPORT" 
        <chrome-platform@...ts.linux.dev>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND PATCH 05/11] platform/chrome: cros_ec_proto: separate
 cros_ec_wait_until_complete()

On Thu, Jul 14, 2022 at 07:29:45AM -0700, Guenter Roeck wrote:
> On Wed, Jul 13, 2022 at 8:33 PM Tzung-Bi Shih <tzungbi@...nel.org> wrote:
> > On Wed, Jul 13, 2022 at 11:15:47AM -0700, Guenter Roeck wrote:
> > > On Mon, Jun 27, 2022 at 7:49 PM Tzung-Bi Shih <tzungbi@...nel.org> wrote:
> > > > +               ret = cros_ec_xfer_command(ec_dev, msg);
> > > > +               if (ret == -EAGAIN)
> > > > +                       continue;
> > > > +               if (ret < 0)
> > > > +                       break;
> > >
> > > With the command allocated on the stack, this can return immediately.
> >
> > Nack, the function has no goto labels.  `return ret` follows the loop
> > immediately.  The `break` here doesn't make it to become too complicated.
> > I would prefer to keep it.
> 
> Sorry, you lost me here. The code after the loop does
> 
>            kfree(msg);
>            return ret;
> 
> If kfree() is no longer necessary, only the return statement is left. So break;
> is identical to return ret;. Am I missing something ?

You are correct.

I meant personally I would prefer to use `break`:
  * The loop is short so that it won't become too complicated.
  * Keep the function has a single exit point.

But, anyway, let's use `return ret` to make it explicit.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ