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:   Wed, 13 Apr 2022 20:06:27 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh@...nel.org>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>, Daniel Scally <djrscally@...il.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Len Brown <lenb@...nel.org>,
        Nuno Sá <nuno.sa@...log.com>,
        Michael Walle <michael@...le.cc>
Subject: Re: [PATCH v6 1/5] device property: Allow error pointer to be passed
 to fwnode APIs

On Mon, Apr 11, 2022 at 5:49 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> On Mon, Apr 11, 2022 at 04:28:06PM +0200, Greg Kroah-Hartman wrote:
> > On Mon, Apr 11, 2022 at 04:50:11PM +0300, Andy Shevchenko wrote:
> > > On Fri, Apr 08, 2022 at 09:48:40PM +0300, Andy Shevchenko wrote:
> > > > Some of the fwnode APIs might return an error pointer instead of NULL
> > > > or valid fwnode handle. The result of such API call may be considered
> > > > optional and hence the test for it is usually done in a form of
> > > >
> > > >   fwnode = fwnode_find_reference(...);
> > > >   if (IS_ERR(fwnode))
> > > >           ...error handling...
> > > >
> > > > Nevertheless the resulting fwnode may have bumped the reference count
> > > > and hence caller of the above API is obliged to call fwnode_handle_put().
> > > > Since fwnode may be not valid either as NULL or error pointer the check
> > > > has to be performed there. This approach uglifies the code and adds
> > > > a point of making a mistake, i.e. forgetting about error point case.
> > > >
> > > > To prevent this, allow an error pointer to be passed to the fwnode APIs.
> > >
> > > Rafael and Greg, if this okay for you, can the first three patches be
> > > applied, so we will have at least the fix in and consider constification
> > > a further work?
> >
> > Give us a chance, you sent this on friday and are asking about it first
> > thing Monday morning?
> >
> > Please go and review other patches sent on the list to help us catch up.
>
> OK! Reviewed (actually commented on) a few patches so far.

I've just queued up the first three patches in the series for 5.19.

Thanks!

Powered by blists - more mailing lists