diff mbox series

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

Message ID Y/x/6kHCjnQHqOpF@kili (mailing list archive)
State Accepted
Commit 8f9850dd8d23c1290cb642ce9548a440da5771ec
Delegated to: Netdev Maintainers
Headers show
Series [net] net: phy: unlock on error in phy_probe() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 1 maintainers not CCed: andrew@lunn.ch
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter Feb. 27, 2023, 10:03 a.m. UTC
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 <error27@gmail.com>
---
 drivers/net/phy/phy_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Oleksij Rempel Feb. 27, 2023, 10:11 a.m. UTC | #1
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 <error27@gmail.com>

Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>

Thank you!

> ---
>  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
> 
>
patchwork-bot+netdevbpf@kernel.org Feb. 28, 2023, noon UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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 <error27@gmail.com>
> ---
>  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!
diff mbox series

Patch

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.