Skip to contentSkip to conversation

net: phy: fix a return path in get_phy_c45_ids()

PATCH Superseded Charles Perry 2 participants 3 messages Apr 8

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: fix a return path in get_phy_c45_ids()

The return value of phy_c45_probe_present() is store in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering -ENODEV fatal wasn't achieved.

Fixes 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")
---
 drivers/net/phy/phy_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/phy_device.c +2 -2
index 81984d4ebb7c..810327fa886a 100644
@@ -973,8 +973,8 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr,
 				/* returning -ENODEV doesn't stop bus
 				 * scanning
 				 */
-				return (phy_reg == -EIO ||
-					phy_reg == -ENODEV) ? -ENODEV : -EIO;
+				return (ret == -EIO ||
+					ret == -ENODEV) ? -ENODEV : -EIO;
 
 			if (!ret)
 				continue;
Signature · 1 line
2.47.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Charles Perry

The return value of phy_c45_probe_present() is store in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering -ENODEV fatal wasn't achieved.

Fixes 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")

Thanks for fixing this.

The Subject line should be [PATCH net] since this is a Fix.

Otherwise:

Andrew

#2 lore raw
Quoted 7 lines · Andrew Lunn
Quoted 6 lines · Charles Perry

The return value of phy_c45_probe_present() is store in "ret", not "phy_reg", fix this. "phy_reg" always has a positive value if we reach this return path (since it would have returned earlier otherwise), which means that the original goal of the patch of not considering -ENODEV fatal wasn't achieved.

Quoted 6 lines
Quoted 2 lines
Fixes 17b447539408 ("net: phy: c45 scanning: Don't consider -ENODEV fatal")

Thanks for fixing this.

The Subject line should be [PATCH net] since this is a Fix.

Ok, I'll resend this with the proper patch prefix.

Thanks,
Charles

Quoted 6 lines

Otherwise:

Andrew