Skip to content

Commit c69c29a

Browse files
khoroshilovdavem330
authored andcommitted
net: stmmac: dwmac-rk: fix error handling in rk_gmac_powerup()
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]>
1 parent 417c804 commit c69c29a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,10 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv)
13421342
}
13431343

13441344
ret = phy_power_on(bsp_priv, true);
1345-
if (ret)
1345+
if (ret) {
1346+
gmac_clk_enable(bsp_priv, false);
13461347
return ret;
1348+
}
13471349

13481350
pm_runtime_enable(dev);
13491351
pm_runtime_get_sync(dev);

0 commit comments

Comments
 (0)