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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 6 Jun 2023 12:25:41 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Sean Anderson <sean.anderson@...o.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Ioana Ciornei <ioana.ciornei@....com>,
	Jakub Kicinski <kuba@...nel.org>,
	Madalin Bucur <madalin.bucur@....com>, netdev@...r.kernel.org,
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net-next 4/8] net: pcs: lynx: add lynx_pcs_create_fwnode()

On Fri, Jun 02, 2023 at 11:51:23AM -0400, Sean Anderson wrote:
> On 6/2/23 11:45, Russell King (Oracle) wrote:
> > Add a helper to create a lynx PCS from a fwnode handle.
> > 
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> > ---
> >  drivers/net/pcs/pcs-lynx.c | 29 +++++++++++++++++++++++++++++
> >  include/linux/pcs-lynx.h   |  1 +
> >  2 files changed, 30 insertions(+)
> > 
> > diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c
> > index a90f74172f49..b0907c67d469 100644
> > --- a/drivers/net/pcs/pcs-lynx.c
> > +++ b/drivers/net/pcs/pcs-lynx.c
> > @@ -353,6 +353,35 @@ struct phylink_pcs *lynx_pcs_create_mdiodev(struct mii_bus *bus, int addr)
> >  }
> >  EXPORT_SYMBOL(lynx_pcs_create_mdiodev);
> >  
> > +struct phylink_pcs *lynx_pcs_create_fwnode(struct fwnode_handle *node)
> > +{
> > +	struct mdio_device *mdio;
> > +	struct phylink_pcs *pcs;
> 
> I think you should put the available check here as well.

Sorry, I totally missed your comment.

Yes, that would also fix the refcount leak in memac_pcs_create(). I
thought about that, but I decided against it because in dpaa2:

        if (!fwnode_device_is_available(node)) {
                netdev_err(mac->net_dev, "pcs-handle node not available\n");
                fwnode_handle_put(node);
                return -ENODEV;
        }

would become:

        if (IS_ERR(pcs)) {
                netdev_err(mac->net_dev,
                           "lynx_pcs_create_fwnode() failed: %pe\n", pcs);

If the device is not available, the error message changes from
	pcs-handle node not available
to
	lynx_pcs_create_fwnode() failed: ENODEV

which doesn't really say what the problem was. Is this something that
the DPAA2 maintainers care about?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ