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:   Thu, 24 Mar 2022 10:39:47 +0100
From:   Philipp Zabel <p.zabel@...gutronix.de>
To:     Clément Léger <clement.leger@...tlin.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Allan Nielsen <allan.nielsen@...rochip.com>,
        linux-kernel@...r.kernel.org, devicetree@...r.kernel.org
Subject: Re: [PATCH 2/2] reset: add support for fwnode

Hi Clément,

On Do, 2022-03-24 at 10:19 +0100, Clément Léger wrote:
> Le Wed, 23 Mar 2022 17:21:21 +0100,
> Clément Léger <clement.leger@...tlin.com> a écrit :
> 
> > > >         if (id) {
> > > > -               index = of_property_match_string(node,
> > > > -                                                "reset-names",
> > > > id);
> > > > +               index = fwnode_property_match_string(fwnode,
> > > > "reset-names", id);
> > > >                 if (index == -EILSEQ)
> > > >                         return ERR_PTR(index);    
> > > 
> > > I don't think this is good enough any more. At least -ENOMEM is added
> > > as a possible error return code by this change.  
> > 
> > Yes indeed, errors are clearly not correctly handled anymore. At least
> > -EILSEQ won't be triggered.
> > > 
> 
> By the way, even after looking at this more carefully, I'm not sure to
> understand why there is a special handling for -EILSEQ ? From what I
> understand, EILSEQ is returned in case the device tree is malformed
> (string longer than returned property length) but why is it handled
> differently in this case ?

of_property_match_string() can return four error codes:

  -EINVAL (no reset-names property in node)
  -EILSEQ (real error)
  -ENODATA (id is not found in reset-names)
  -ENOSYS (CONFIG_OF is not set)

-EINVAL, -ENODATA and -ENOSYS map to -ENOENT (no reset control
corresponding to id found), or no error if it is optional.

regards
Philipp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ