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: <20200225123839.GT25745@shell.armlinux.org.uk>
Date:   Tue, 25 Feb 2020 12:38:39 +0000
From:   Russell King - ARM Linux admin <linux@...linux.org.uk>
To:     Sudheesh Mavila <sudheesh.mavila@....com>
Cc:     andrew@...n.ch, f.fainelli@...il.com, hkallweit1@...il.com,
        davem@...emloft.net, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: phy: corrected the return value for
 genphy_check_and_restart_aneg

On Tue, Feb 25, 2020 at 05:52:08PM +0530, Sudheesh Mavila wrote:
> When auto-negotiation is not required, return value should be zero.
> 
> Signed-off-by: Sudheesh Mavila <sudheesh.mavila@....com>

Hi,

Thanks for spotting this problem. However, it looks like the same
problem also exists in genphy_c45_check_and_restart_aneg(). It would
be a good idea to fix both at the same time.

Thanks.

> ---
>  drivers/net/phy/phy_device.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 6a5056e0ae77..36cde3dac4c3 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1806,10 +1806,13 @@ int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
>  			restart = true;
>  	}
>  
> -	if (restart)
> -		ret = genphy_restart_aneg(phydev);
> +	/* Only restart aneg if we are advertising something different
> +	 * than we were before.
> +	 */
> +	if (restart > 0)
> +		return genphy_restart_aneg(phydev);
>  
> -	return ret;
> +	return 0;
>  }
>  EXPORT_SYMBOL(genphy_check_and_restart_aneg);
>  
> -- 
> 2.17.1
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ