From: Antoine Tenart Date: Thu, 25 Jun 2020 15:42:05 +0000 (+0200) Subject: net: phy: mscc: fix a possible double unlock X-Git-Tag: v5.10.7~1943^2~417^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b16a213b4d68022011ddaabd583c855d7e5ec5b2;p=platform%2Fkernel%2Flinux-rpi.git net: phy: mscc: fix a possible double unlock On vsc8584_ptp_init failure we jump to the 'err' label, which unlocks the MDIO bus lock. But vsc8584_ptp_init isn't called with the MDIO bus lock taken, which could result in a double unlock. Fix this. Fixes: ab2bf9339357 ("net: phy: mscc: 1588 block initialization") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c index 2a70829..cb4e15d 100644 --- a/drivers/net/phy/mscc/mscc_main.c +++ b/drivers/net/phy/mscc/mscc_main.c @@ -1436,7 +1436,7 @@ static int vsc8584_config_init(struct phy_device *phydev) ret = vsc8584_ptp_init(phydev); if (ret) - goto err; + return ret; phy_write(phydev, MSCC_EXT_PAGE_ACCESS, MSCC_PHY_PAGE_STANDARD);