[PATCH 23/62] net: phy: mxl-86110: Fix locking in an error path
From: Bart Van Assche
Date: Mon Feb 23 2026 - 17:09:34 EST
From: Bart Van Assche <bvanassche@xxxxxxx>
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 <daniel@xxxxxxxxxxxxxx>
Cc: Andrew Lunn <andrew@xxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
Cc: Xu Liang <lxu@xxxxxxxxxxxxx>
Cc: netdev@xxxxxxxxxxxxxxx
Fixes: 3d1b3f4ffc0a ("net: phy: mxl-86110: add basic support for MxL86111 PHY")
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
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);