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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 29 May 2021 12:28:37 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Pavel Machek <pavel@....cz>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Amireddy Mallikarjuna reddy 
        <mallikarjunax.reddy@...ux.intel.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Marek BehĂșn <marek.behun@....cz>,
        Abanoub Sameh <abanoubsameh8@...il.com>,
        Dan Murphy <dmurphy@...com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 08/28] leds: lgm-sso: Put fwnode in any case during ->probe()

On Fri, May 28, 2021 at 1:08 PM Pavel Machek <pavel@....cz> wrote:

> > @@ -734,10 +736,15 @@ static int sso_led_dt_parse(struct sso_led_priv *priv)
> >       if (fw_ssoled) {
> >               ret = __sso_led_dt_parse(priv, fw_ssoled);
> >               if (ret)
> > -                     return ret;
> > +                     goto err_child_out;
> >       }
> >
> > +     fwnode_handle_put(fw_ssoled);
> >       return 0;
> > +
> > +err_child_out:
> > +     fwnode_handle_put(fw_ssoled);
> > +     return ret;
> >  }
>
> Just delete the return and you get the same effect, no? No need to
> have two exits here.

Okay, I have tried and neither result is better:
option 1. Add ret = 0, but keep the label
option 2. Assign 0 to ret at the definition stage and replace return
with break and remove return 0 (I don't like that ret assigned to 0 in
the definition block. It usually may lead to subtle errors)
option 3+. Something I missed which you see can be done?

Which one do you prefer?

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ