From: Dan Carpenter Date: Fri, 29 May 2020 10:02:07 +0000 (+0300) Subject: net: phy: marvell: unlock after phy_select_page() failure X-Git-Tag: baikal/mips/sdk5.9~13530^2~61 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=14814ce8493e142f20874d2c98315921441d192e;p=kernel.git net: phy: marvell: unlock after phy_select_page() failure We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function. Fixes: e98f0bf1b985 ("net : phy: marvell: Speedup TDR data retrieval by only changing page once") Signed-off-by: Dan Carpenter Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 2c04e3b2b285f..4ea226566cec9 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1867,7 +1867,7 @@ static int marvell_vct5_amplitude_graph(struct phy_device *phydev) */ page = phy_select_page(phydev, MII_MARVELL_VCT5_PAGE); if (page < 0) - return page; + goto restore_page; for (distance = priv->first; distance <= priv->last;