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, 7 Apr 2022 13:19:44 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Michael Walle <michael@...le.cc>
Cc:     linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
        Daniel Scally <djrscally@...il.com>,
        Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>,
        Nuno Sá <nuno.sa@...log.com>
Subject: Re: [PATCH v5 1/4] device property: Allow error pointer to be passed
 to fwnode APIs

On Wed, Apr 06, 2022 at 08:05:23PM +0200, Michael Walle wrote:

...

> > +	if (IS_ERR_OR_NULL(fwnode))
> > +		return -ENOENT;
> > +
> >  	ret = fwnode_call_int_op(fwnode, get_reference_args, prop, nargs_prop,
> >  				 nargs, index, args);
> > +	if (ret == 0)
> > +		return ret;
> > 
> > -	if (ret < 0 && !IS_ERR_OR_NULL(fwnode) &&
> > -	    !IS_ERR_OR_NULL(fwnode->secondary))
> > -		ret = fwnode_call_int_op(fwnode->secondary, get_reference_args,
> > -					 prop, nargs_prop, nargs, index, args);
> > +	if (IS_ERR_OR_NULL(fwnode->secondary))
> > +		return -ENOENT;
> 
> Doesn't this mean you overwrite any return code != 0 with -ENOENT?
> Is this intended?

Indeed, it would shadow the error code.
So, it should go with

	if (IS_ERR_OR_NULL(fwnode->secondary))
		return ret;

then.

> In any case:
> Tested-by: Michael Walle <michael@...le.cc>

Thanks!

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ