Subject: [PATCH 23/62] net: phy: mxl-86110: Fix locking in an error path

From: Bart Van Assche <[email-masked]>
Date: Mon, 23 Feb 2026 14:00:23 -0800

From: Bart Van Assche <[email-masked]>

Only call phy_unlock_mdio_bus() if phy_lock_mdio_bus() has been called
first. This has been detected by the Clang thread-safety analyzer.

Cc: Daniel Golle <[email-masked]>
Cc: Andrew Lunn <[email-masked]>
Cc: Jakub Kicinski <[email-masked]>
Cc: Xu Liang <[email-masked]>
Cc: [email-masked]
Fixes: 3d1b3f4ffc0a ("net: phy: mxl-86110: add basic support for MxL86111 PHY")
Signed-off-by: Bart Van Assche <[email-masked]>
---
 drivers/net/phy/mxl-86110.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/mxl-86110.c b/drivers/net/phy/mxl-86110.c
index 42a5fe3f115f..d010b023f7b9 100644
--- a/drivers/net/phy/mxl-86110.c
+++ b/drivers/net/phy/mxl-86110.c
@@ -891,7 +891,7 @@ static int mxl86111_config_inband(struct phy_device *phydev, unsigned int modes)
 			       MII_BMCR, BMCR_ANENABLE,
 			       (modes == LINK_INBAND_DISABLE) ? 0 : BMCR_ANENABLE);
 	if (ret < 0)
-		goto out;
+		return ret;
 
 	phy_lock_mdio_bus(phydev);