Message ID | 20200625154211.606591-3-antoine.tenart@bootlin.com |
---|---|
State | New |
Headers | show |
Series | [net-next,1/8] net: phy: mscc: macsec: fix sparse warnings | expand |
diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c index 2a7082983c09..cb4e15d6e2db 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);
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 <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> --- drivers/net/phy/mscc/mscc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)