Skip to contentSkip to conversation

net: phy: unlock on error in phy_probe()

PATCH Applied Dan Carpenter 3 participants 3 messages Feb 27, 2023 – Feb 28, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: unlock on error in phy_probe()

If genphy_c45_read_eee_adv() fails then we need to do a reset and unlock the &phydev->lock mutex before returning.

Fixes 3eeca4e199ce ("net: phy: do not force EEE support")
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy_device.c +1 -1
index 3f8a64fb9d71..9e9fd8ff00f6 100644
@@ -3146,7 +3146,7 @@ static int phy_probe(struct device *dev)
 	 */
 	err = genphy_c45_read_eee_adv(phydev, phydev->advertising_eee);
 	if (err)
-		return err;
+		goto out;
 
 	/* There is no "enabled" flag. If PHY is advertising, assume it is
 	 * kind of enabled.
Signature · 1 line
2.39.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

If genphy_c45_read_eee_adv() fails then we need to do a reset and unlock the &phydev->lock mutex before returning.

Fixes 3eeca4e199ce ("net: phy: do not force EEE support")

Thank you!

Quoted 21 lines
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/phy_device.c +1 -1
index 3f8a64fb9d71..9e9fd8ff00f6 100644
@@ -3146,7 +3146,7 @@ static int phy_probe(struct device *dev)
 	 */
 	err = genphy_c45_read_eee_adv(phydev, phydev->advertising_eee);
 	if (err)
-		return err;
+		goto out;
 
 	/* There is no "enabled" flag. If PHY is advertising, assume it is
 	 * kind of enabled.
Signature · 1 line
2.39.1
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Mon, 27 Feb 2023 13:03:22 +0300 you wrote:

If genphy_c45_read_eee_adv() fails then we need to do a reset and unlock the &phydev->lock mutex before returning.

Fixes 3eeca4e199ce ("net: phy: do not force EEE support")
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
- [net] net: phy: unlock on error in phy_probe()

    https://git.kernel.org/netdev/net/c/8f9850dd8d23

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html