[net,v1,1/1] net: phy: c45: fix network interface initialization failures on xtensa, arm:cubieboard

Message ID 20230225071644.2754893-1-o.rempel@pengutronix.de
State New
Headers
Series [net,v1,1/1] net: phy: c45: fix network interface initialization failures on xtensa, arm:cubieboard |

Commit Message

Oleksij Rempel Feb. 25, 2023, 7:16 a.m. UTC
  Without proper initialization, "changed" returned random numbers and caused
interface initialization failures.

Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/phy/phy-c45.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Horman Feb. 25, 2023, 4:43 p.m. UTC | #1
On Sat, Feb 25, 2023 at 08:16:44AM +0100, Oleksij Rempel wrote:
> Without proper initialization, "changed" returned random numbers and caused
> interface initialization failures.
> 
> Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Tested-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Simon Horman <simon.horman@corigine.com>
  
Jakub Kicinski Feb. 27, 2023, 9:16 p.m. UTC | #2
On Sat, 25 Feb 2023 08:16:44 +0100 Oleksij Rempel wrote:
> Without proper initialization, "changed" returned random numbers and caused
> interface initialization failures.
> 
> Fixes: 022c3f87f88e ("net: phy: add genphy_c45_ethtool_get/set_eee() support")
> Reported-by: Guenter Roeck <linux@roeck-us.net>
> Tested-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Applied, thanks!
  

Patch

diff --git a/drivers/net/phy/phy-c45.c b/drivers/net/phy/phy-c45.c
index 3813b86689d0..fee514b96ab1 100644
--- a/drivers/net/phy/phy-c45.c
+++ b/drivers/net/phy/phy-c45.c
@@ -672,7 +672,7 @@  EXPORT_SYMBOL_GPL(genphy_c45_read_mdix);
  */
 int genphy_c45_write_eee_adv(struct phy_device *phydev, unsigned long *adv)
 {
-	int val, changed;
+	int val, changed = 0;
 
 	if (linkmode_intersects(phydev->supported_eee, PHY_EEE_CAP1_FEATURES)) {
 		val = linkmode_to_mii_eee_cap1_t(adv);