[PATCH net] net: phy: unlock on error in phy_probe()

Subsystems: ethernet phy library, networking drivers, the rest

STALE1291d

3 messages, 3 authors, 2023-02-28 · open the first message on its own page

[PATCH net] net: phy: unlock on error in phy_probe()

From: Dan Carpenter <hidden>
Date: 2023-02-27 10:03:54

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")
Signed-off-by: Dan Carpenter <redacted>
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3f8a64fb9d71..9e9fd8ff00f6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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.
-- 
2.39.1

Re: [PATCH net] net: phy: unlock on error in phy_probe()

From: Oleksij Rempel <o.rempel@pengutronix.de>
Date: 2023-02-27 10:13:44

On Mon, Feb 27, 2023 at 01:03:22PM +0300, Dan Carpenter 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")
Signed-off-by: Dan Carpenter <redacted>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>

Thank you!
quoted hunk
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 3f8a64fb9d71..9e9fd8ff00f6 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -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.
-- 
2.39.1
-- 
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 |

Re: [PATCH net] net: phy: unlock on error in phy_probe()

From: patchwork-bot+netdevbpf@kernel.org
Date: 2023-02-28 12:00:25

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni [off-list ref]:

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")
Signed-off-by: Dan Carpenter <redacted>
---
 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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help