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, 5 May 2021 02:25:39 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Ansuel Smith <ansuelsmth@...il.com>
Cc:     Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH net-next v3 04/20] net: dsa: qca8k: handle
 qca8k_set_page errors

> +static int
>  qca8k_set_page(struct mii_bus *bus, u16 page)
>  {
>  	if (page == qca8k_current_page)
> -		return;
> +		return 0;
>  
> -	if (bus->write(bus, 0x18, 0, page) < 0)
> +	if (bus->write(bus, 0x18, 0, page) < 0) {
>  		dev_err_ratelimited(&bus->dev,
>  				    "failed to set qca8k page\n");
> +		return -EBUSY;

EBUSY is a bit odd. bus->write() should return an error code. Please
return that.

> @@ -161,14 +169,19 @@ static void
>  qca8k_write(struct qca8k_priv *priv, u32 reg, u32 val)
>  {
>  	u16 r1, r2, page;
> +	int ret;
>  
>  	qca8k_split_addr(reg, &r1, &r2, &page);
>  
>  	mutex_lock_nested(&priv->bus->mdio_lock, MDIO_MUTEX_NESTED);
>  
> -	qca8k_set_page(priv->bus, page);
> +	ret = qca8k_set_page(priv->bus, page);
> +	if (ret < 0)
> +		goto exit;
> +
>  	qca8k_mii_write32(priv->bus, 0x10 | r2, r1, val);
>  
> +exit:
>  	mutex_unlock(&priv->bus->mdio_lock);

Maybe make this function also return the error? 

>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ