Skip to content

Commit

Permalink
net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
khoroshilov authored and davem330 committed Jan 28, 2019
1 parent 417c804 commit c69c29a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c69c29a

Please sign in to comment.