]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sat, 26 Jan 2019 19:48:57 +0000 (22:48 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2019 07:03:38 +0000 (23:03 -0800)
If phy_power_on() fails in rk_gmac_powerup(), clocks are left enabled.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

index 7b923362ee5509d6fdedc9c15d09cd760182fab2..3b174eae77c10f3b9da3aa9d89d850535233a87c 100644 (file)
@@ -1342,8 +1342,10 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
        }
 
        ret = phy_power_on(bsp_priv, true);
-       if (ret)
+       if (ret) {
+               gmac_clk_enable(bsp_priv, false);
                return ret;
+       }
 
        pm_runtime_enable(dev);
        pm_runtime_get_sync(dev);