Skip to content

Commit

Permalink
net: phy: unlock on error in phy_probe()
Browse files Browse the repository at this point in the history
If genphy_c45_read_eee_adv() fails then we need to do a reset and unlock
the &phydev->lock mutex before returning.

Fixes: 3eeca4e ("net: phy: do not force EEE support")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/Y/x/6kHCjnQHqOpF@kili
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Dan Carpenter authored and Paolo Abeni committed Feb 28, 2023
1 parent 11f180a commit 8f9850d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 8f9850d

Please sign in to comment.