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]
Message-ID: <YLq04ap4kjuPRKVe@lunn.ch>
Date:   Sat, 5 Jun 2021 01:18:57 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Oleksij Rempel <o.rempel@...gutronix.de>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Heiner Kallweit <hkallweit1@...il.com>,
        Russell King <linux@...linux.org.uk>, kernel@...gutronix.de,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH net-next v1 2/7] net: usb: asix: ax88772: add phylib
 support

On Fri, Jun 04, 2021 at 03:42:39PM +0200, Oleksij Rempel wrote:
> To be able to use ax88772 with external PHYs and use advantage of

s/use/take/

> +/* MDIO read and write wrappers for phylib */
> +int asix_mdio_bus_read(struct mii_bus *bus, int phy_id, int regnum)
> +{
> +	return asix_mdio_read(((struct usbnet *)bus->priv)->net, phy_id,
> +			      regnum);
> +}

Please avoid this cast. priv should be a void *, so you can do

       struct usbnet *priv = bus->priv;

       return asix_mdio_read(priv->net, phy_id, regnum);

> +static int ax88772_init_phy(struct usbnet *dev)
> +{
> +	struct asix_common_private *priv = dev->driver_priv;
> +	int ret;
> +
> +	priv->phy_addr = asix_get_phy_addr(dev);
> +	/* asix_read_phy_addr() is using ret < 2 as error value */
> +	if (priv->phy_addr < 2)
> +		return -ENODEV;

Really?

ax88172a.c does not check. ax88172_bind() does not
check. ax88772_bind() does not check. As far as i can see, nothing
really cares.

So please add another cleanup patch and make asix_read_phy_addr()
return -ENODEV.

Otherwise, this looks O.K.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ